使用JSON响应清理PHP文件的URL

I'm a bit new to all of this and have looked up various solutions but I seem to be constantly implementing it wrong.

I have a PHP file that returns JSON that I want to use to build an API.

Here is my example URL:

https://db.ygoprodeck.com/api/cardinfo.php?name=Kuriboh

This currently returns a JSON output for users to use.

Is it possible, through .htaccess or another method to convert the URL so this can be used:

https://db.ygoprodeck.com/api/cardinfo/name/Kuriboh

Or maybe something along those lines.

I feel like I'm not quite understanding what I am doing. I have a PHP file that returns information as requested. Is that still considered an API even though I don't have the proper syntax for the URL in place?