Docs
  • 👋Welcome
    • Overview
    • Placekey Design
    • Placekey Types
  • API Overview
    • Authentication
    • Usage Limits
    • Error Codes
    • Supported Countries
  • Placekey API
    • Quick Start
    • Input Parameters
      • Minimum Inputs
      • Optional Parameters
    • Response
      • Optional Responses
    • Bulk API
    • Example Queries
    • Placekey Lineage File
  • Geocoder
    • Introduction
    • Usage Limit
    • Status Descriptions
    • Example
  • Join Data Product
    • Join Data
  • Libraries
    • Python
    • Javascript
  • Integrations
    • Google Sheets Add On
Powered by GitBook
On this page
  • Get a Placekey for a POI
  • Get a Placekey for an address
  • Get a Placekey for a pair of coordinates
  • Get a Placekey with a query ID of your choice
  1. Placekey API

Example Queries

If this is your first time using the API please reference the Quick Start section to get familiar with getting a placekey as a response. The example queries below show how to include optional paramaters and return additional placekey types like address_placekey and building_placekey as well as additional fields like confidence_score.

Get a Placekey for a POI

Example Request:

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.7371,
    "longitude": -122.44283,
    "place_metadata": {
      "store_id": "1234",
      "phone_number": "1234567890",
      "website": "sfgsa.org",
      "naics_code": "712120",
      "mcc_code": "9399"
    }
  },
      "options":{"fields":["address_placekey", "building_placekey", "confidence_score"]
}'
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.7371,
    "longitude": -122.44283,
    "place_metadata": {
      "store_id": "1234",
      "phone_number": "1234567890",
      "website": "sfgsa.org",
      "naics_code": "712120",
      "mcc_code": "9399"
    }
  },
  "options": {
    "fields": [
      "address_placekey",
      "building_placekey",
      "confidence_score"
    ]
  }
})
headers = {
  'apikey': '{{apikey}}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Example Response:


{
  "query_id": "0",
  "placekey": "zzw-228@5vg-7gt-f9f",
  "address_placekey": "246@5vg-7gt-f9f",
  "building_placekey": "227@5vg-7gt-f9f",
  "confidence_score": "HIGH",
  "normalized_address": {
    "street_address": "225 Bush St Ste 100",
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94104",
    "iso_country_code": "US"
  }
}

Get a Placekey for an address

Example Request:

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
  },
    "options":{"fields":["building_placekey", "confidence_score", "upi", "parcel,"geoid"]}
}'
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
  },
  "options": {
    "fields": [
      "building_placekey",
      "confidence_score",
      "upi",
      "parcel",
      "geoid"
    ]
  }
})
headers = {
  'apikey': '{{apikey}}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Example Response:

{
  "query_id": "0",
  "placekey": "22g@5vg-7gq-5mk",
  "building_placekey": "22g@5vg-7gq-5mk",
  "confidence_score": "HIGH",
  "upi": "urn:reso:upi:2.0:US:06075:3511080",
  "parcel": "3511080",
  "geoid": "06075"
}

Get a Placekey for a pair of coordinates

Example Request:

curl --location 'https://api.placekey.io/v1/placekey' \
--header 'apikey: {{apikey}}' \
--header 'Content-Type: application/json' \
--data '{
    "query": {
        "latitude": 37.7371,
        "longitude": -122.44283
    }
}'
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.request("POST", url, headers=headers, data=payload)

print(response.text)

Example Response:

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

Get a Placekey with a query ID of your choice

With multiple queries, you can also specify an ID with each query that echoes back, if you'd like.

Example Request:

curl --location 'https://api.placekey.io/v1/placekeys' \
--header 'apikey: {{apikey}}' \
--header 'Content-Type: application/json' \
--data '{
    "queries": [
        {
            "street_address": "1543 Mission Street, Floor 3",
            "city": "San Francisco",
            "region": "CA",
            "postal_code": "94105",
            "iso_country_code": "US"
        },
        {
            "query_id": "thisqueryidaloneiscustom",
            "location_name": "Twin Peaks Petroleum",
            "street_address": "598 Portola Dr",
            "city": "San Francisco",
            "region": "CA",
            "postal_code": "94131",
            "iso_country_code": "US"
        },
        {
            "latitude": 37.7371,
            "longitude": -122.44283
        }
    ]
}'
import requests
import json

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

payload = json.dumps({
  "queries": [
    {
      "street_address": "1543 Mission Street, Floor 3",
      "city": "San Francisco",
      "region": "CA",
      "postal_code": "94105",
      "iso_country_code": "US"
    },
    {
      "query_id": "thisqueryidaloneiscustom",
      "location_name": "Twin Peaks Petroleum",
      "street_address": "598 Portola Dr",
      "city": "San Francisco",
      "region": "CA",
      "postal_code": "94131",
      "iso_country_code": "US"
    },
    {
      "latitude": 37.7371,
      "longitude": -122.44283
    }
  ]
})
headers = {
  'apikey': '{{apikey}}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Example Response:

[
  {
    "query_id": "0",
    "placekey": "226@5vg-7gq-5mk"
  },
  {
    "query_id": "thisqueryidaloneiscustom",
    "placekey": "227-223@5vg-82n-pgk"
  },
  {
    "query_id": "2",
    "placekey": "@5vg-82n-kzz"
  }
]

PreviousBulk APINextPlacekey Lineage File

Last updated 2 months ago