As any DNS filter, Pi-hole isn't concerned with URLs, but with domains only.
Extracting such a domain from any given URL is easy enough, but it usually would result in overblocking if you are indeed trying to block just the resource as indicated by the URL originally.
To block on URL level, you'd have to use a browser extension like uBlock Origin.
With the regard to blocking domains, the following may help: