# 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="https://1673832482-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQSBrzF1ArQHOjIoTswkG%2Fuploads%2FFcG6znHd3WfgpvqIfOqw%2Fclearinghouse_query.png?alt=media&#x26;token=8f6e208b-4784-4238-9fad-bc2e740ee84d" 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](https://api.clearinghouse.net/api-reference-v2p1/endpoints/case-type) 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 %}
