Searching for a specific URL

answered

#1

I’m trying to find a specific URL using the articles endpoint, but I keep getting nothing back. I’m trying the following in my query. What am I doing wrong?

{
    "filters": [
        "www.someurl.com/the-page-slug"
    ]
}

#2

Hey. Not a problem! You’re almost there with that filter. Let me help out…

When you pop a string into the filter without specifying a field, we assume you’re doing a keyword search. By default, that means checking for the string in the headline, summary, and list of authors. Obviously, it’s highly unlikely that URL will be in any of those places.

So, to achieve what you need, simply specify that you’re doing a search for a URL, using the href parameter. For example:

{
    "filters": [
        "href:\"www.someurl.com/the-page-slug\""
    ]
}

Note that we’ve escaped the " characters to make the query work.

You can find more about the available filters for the v1/articles endpoint here.

Hope that helps!