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"]}
}'

Example Response:

{
  "query_id": "0",
  "placekey": "223-227@5vg-7gq-tvz",
  "address_placekey": "0kiksjkpg4@5vg-7gq-tvz",
  "building_placekey": "0kiksjkpg4@5vg-7gq-tvz",
  "confidence_score": "HIGH"
}

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"]}
}'

Example Response:

{
  "query_id": "0",
  "placekey": "0rsdbudq45@5vg-7gq-5mk",
  "building_placekey": "22g@5vg-7gq-5mk",
  "confidence_score": "HIGH"
}

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
    }
}'

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
        }
    ]
}'

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"
  }
]

Last updated