In our previous post, we helped you get started with the Placekey API. Whether it’s establishing the market rate for a property, helping environmentalists study global warming trends in a neighborhood, or getting your food delivered to the right address, matching addresses correctly is crucial in this day and age. Placekey believes that such location data can be combined so as to drive a greater good, unlocking new insights on location data. With this post, you’ll learn how to get a Placekey for single locations, points-of-interest, bulk entries, and more.
In order to properly locate a physical address, the Placekey API’s matching algorithm tries a few different queries sequentially, returning the best match of the first query with a high enough score to feel assured it's a true match. It runs 5 such queries, in this order:
- If the address you've sent in is valid, then we search for a POI at that address placekey with a name that exactly case-insensitively matches the location_name you've sent in.
- If this does not match (or if the address you sent in wasn't valid) but you've sent in a latitude and longitude with your query, then we search for that location_name and a fuzzy street address within 1km of your coordinates.
- If this still does not match but you've sent in a postal code, then we search specifically for a POI in that postal code and look for a location_name match and a fuzzy street address match
- If none of the above match and you have sent in a city and a region, then we require a strict match on city/region, a match on POI name, and a fuzzy match on street address.
- Finally, if none of the above match, we stop searching for POI and perform an address match.
STRICT NAME MATCH
If strict_name_match is false, all location_name matches after Step 1 are fuzzy. If strict_name_match is true, all location_name matches are exact case-insensitive.
STRICT ADDRESS MATCH
If strict_address_match is false, then address matches are fuzzy across street_address, city, state, and postal_code. If strict_address_match is true, then we reject all matches that do not exactly match the input address fields.
To find the Placekey for a single location, use the /placekey endpoint and specify any complete combination of location information. Below are some examples:
- Get a Placekey for a pair of coordinates
- Get a Placekey with a query ID of your choice
When you specify a query ID, it is echoed back to you. This can be useful if you have lots of queries in flight and you want to line them back up afterwards.
- Get a Placekey for an address
- Get a Placekey for an address with strict address matching
You can also get a Placekey for a Point-of-Interest, or any specific physical location that someone may find interesting or is searching for. (Since it’s a mouthful, Point-of-Interest is often abbreviated as 'POI').
Restaurants, retail stores, and grocery stores are all examples of POI.
- Get a Placekey for a POI with strict name matching
Strictly matching its name, you can get a Placekey for a POI. If the name does not match, we fall back to address matching behaviour.
Beyond single locations and specific names and addresses, if you have a large number of places you want to match, you can send batches of size no more than 100 over at once. We require that all queries in a batch have the same iso_country_code.
- Get Placekeys for multiple things at once
With multiple queries, you also have the option to specify an ID with each query that echoes back.
A Common Error
An error message of “Parameter query is required” can arise when doing Bulk API. Your request body should be a JSON object that contains the query field within which you specify the query parameters you would like to match on. If the parameter is missing you will not be able to match to a placekey. Read the API description to see how to construct a query or try one of the examples listed above.