# Quick Start

In order to make your first request you need an API key. You can create your API key by logging into your [self-service dashboard](https://dev.placekey.io/home).

> 🚧 Need an API Key
>
> If you need an API key you can sign up for an account and get your key [here](https://dev.placekey.io/credentials).

## Get a Placekey for an Address

To get started you can use the below query to get a Placekey for just an address.

Example Request:

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

```bash
curl --location 'https://api.placekey.io/v1/placekey' \
--header 'apikey: {{apikey}}' \
--header 'Content-Type: application/json' \
--data '{
  "query": {
    "street_address": "1543 Mission Street, Floor 3",
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94105",
    "iso_country_code": "US",
    "latitude": 37.7371,
    "longitude": -122.44283
  }
}'
```

{% endtab %}

{% tab title="python" %}

```python
import requests
import json

url = "https://api.placekey.io/v1/placekey"

payload = json.dumps({
  "query": {
    "street_address": "1543 Mission Street, Floor 3",
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94105",
    "iso_country_code": "US",
    "latitude": 37.7371,
    "longitude": -122.44283
  }
})

headers = {
  'apikey': '{{apikey}}',
  'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)
```

{% endtab %}
{% endtabs %}

Example Response:

```json
{
  "query_id": "0",
  "placekey": "22g@5vg-7gq-5mk"
}
```

## Get a Placekey for a POI

Get a Placekey for a POI, a specific physical location which someone may find interesting. Restaurants, retail stores, and grocery stores are all examples of Points-of-Interest. Since the phrase is a mouthful, Point-of-Interest is often abbreviated as 'POI'.

Example Request:

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

```bash
curl --location 'https://api.placekey.io/v1/placekey' \
--header 'apikey: {{apikey}}' \
--header 'Content-Type: application/json' \
--data '{
  "query": {
    "location_name": "San Francisco City Hall",
    "street_address": "1 Dr Carlton B Goodlett Pl",
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94102",
    "iso_country_code": "US",
    "latitude": 37.7793,
    "longitude": -122.4193,
    "place_metadata": {
      "store_id": "1234",
      "phone_number": "1234567890",
      "website": "sfgsa.org",
      "naics_code": "712120",
      "mcc_code": "9399"
    }
  }
}'
```

{% endtab %}

{% tab title="python" %}

```python
import requests
import json

url = "https://api.placekey.io/v1/placekey"

payload = json.dumps({
  "query": {
    "location_name": "San Francisco City Hall",
    "street_address": "1 Dr Carlton B Goodlett Pl",
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94102",
    "iso_country_code": "US",
    "latitude": 37.7793,
    "longitude": -122.4193,
    "place_metadata": {
      "store_id": "1234",
      "phone_number": "1234567890",
      "website": "sfgsa.org",
      "naics_code": "712120",
      "mcc_code": "9399"
    }
  }
})
headers = {
  'apikey': '{{apikey}}',
  'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)
```

{% endtab %}
{% endtabs %}

Example Response:

```json
{
  "query_id": "0",
  "placekey": "1vqew7z3sv@5vg-7gq-tvz"
}
```

## Get a Placekey for a Pair of Coordinates

If you only have a pair of coordinates you can still get a Placekey. The Placekey will only contain the "Where" part. If you need a refresher on the Placekey structure and design visit [this page](/documentation/welcome/placekey-design.md).

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

```bash
curl --location 'https://api.placekey.io/v1/placekey' \
--header 'apikey: {{apikey}}' \
--header 'Content-Type: application/json' \
--data '{
    "query": {
        "latitude": 37.7371,
        "longitude": -122.44283
    }
}'
```

{% endtab %}

{% tab title="python" %}

```python
import requests
import json

url = "https://api.placekey.io/v1/placekey"

payload = json.dumps({
  "query": {
    "latitude": 37.7371,
    "longitude": -122.44283
  }
})
headers = {
  'apikey': '{{apikey}}',
  'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)
```

{% endtab %}
{% endtabs %}

Example Response:

```json
{
  "query_id": "0",
  "placekey": "@5vg-82n-kzz"
}
```


---

# 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://docs.placekey.io/documentation/placekey-api/quick-start.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.
