> For the complete documentation index, see [llms.txt](https://guide.data.gov.sg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.data.gov.sg/developer-guide/api-overview/how-to-use-your-api-key.md).

# How to use your API Key

**Header:**\
`x-api-key: YOUR_API_KEY`

Replace `YOUR_API_KEY` with the API key you generated from the dashboard.

## Curl

```
curl -X GET "https://api-production.data.gov.sg/v2/public/api/collections" \
  -H "x-api-key: YOUR_API_KEY"

```

## Python

```
import requests

headers = {"x-api-key": "YOUR_API_KEY"}
response = requests.get("https://api-production.data.gov.sg/v2/public/api/collections", headers=headers)
print(response.json())

```

## [Google Colab Notebook](https://colab.research.google.com/github/datagovsg/dgs-exploration/blob/master/DataGovSG.ipynb)

> **Keep your API key secure. Do not share your key or expose it in client-side code.**

For details on obtaining your API key, see [How to request an API key.](/developer-guide/api-overview/how-to-request-an-api-key.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://guide.data.gov.sg/developer-guide/api-overview/how-to-use-your-api-key.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.
