> For the complete documentation index, see [llms.txt](https://api.clearinghouse.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.clearinghouse.net/how-to-guides/translating-a-search-url-into-an-api-query.md).

# Translating a Search URL into an API Query

If you have a search query on the Clearinghouse website that you'd like to translate into an equivalent API query, grab the url link from the search bar.

For example, if I did a search on 'Policing' case types and the 'Occupy' special collection, you would do the following on the website:

<figure><img src="/files/xi9qU2unQBJ82Q0ABWwk" alt=""><figcaption></figcaption></figure>

Take a look at the search bar and you will see the following url:

```markup
https://clearinghouse.net/search/case/?case_type=5039&special_collection=5658&ordering=-summary_approved_date
```

The important thing to notice is `case_type=5039` and `special_collection=5658`in the url. If you look up the [Case Type Endpoint](/api-reference-v2p1/endpoints/case-type.md) and [Special Collection Endpoint,](https://github.com/CRClearinghouse/CRLCA/blob/master/api-reference/endpoints/special-collection.md) you will see 5039 correlates to **Policing** and 5658 correlates to **Occupy**. This can be translated into the following API query:

{% tabs %}
{% tab title="URL" %}

```
https://clearinghouse.net/api/v2p1/cases?case_type=5039&special_collection=5658
```

{% endtab %}

{% tab title="python" %}

```
import requests

url = "https://clearinghouse.net/api/v2p1/cases?case_type=5039&special_collection=5658"
headers = { 'Authorization': 'Token XXXXXXXXXX',
'User-Agent': 'Chrome v22.2 Linux Ubuntu'
}
response = requests.request("GET", url, headers=headers, data={})

print(response.text)
```

{% endtab %}
{% endtabs %}
