Hi all, I made a notebook to demonstrate/test the new Python client for the Placekey API. The notebook uses dataset consisting of ~24,000 lat/lon coordinates of cellular towers. First, the requests are sent in bulk to the Python client using PlacekeyAPI.lookup_placekeys()
. The rate limit is hit, an error message is given, and the completed queries are returned. The error message is helpful, but not all the entries are given a placekey because of the rate limit. Second, I wrote a simple wrapper function getPlacekeys()
to send the requests in batches of 50 with a 1 second sleep in between each batch. All entries are given a placekey, but the approach is quite a bit slower.
I’m sure the wrapper function could be further optimized, but this demonstrates the tradeoff. Perhaps in the future the Python client could automatically slow down to avoid rate limit issues? Either way, the Python client makes things much more straightforward!