# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.clearinghouse.net/how-to-guides/translating-a-search-url-into-an-api-query.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
