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
  1. Placekey API

Bulk API

If you have a large number of places you want to match, you can send batches.

🚧 Batch size can be no more than 100 at once. We also require that all queries in a batch have the same iso_country_code

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

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

PreviousOptional ResponsesNextExample Queries

Last updated 8 months ago