Issue with batching many queries

I’m using google places v3 api. This endpoint specifically :

https://api.app.outscraper.com/maps/search-v3

According to the docs I should be able to batch upto 250 queries in an array of strings. Since it has to be sent in query parameters, I’m getting the “Request-URI Too Large” error. Since it is a GET request I can’t put it in the body either.

I need to get this done with the API and I need to batch the queries. The main reason being that we target hyperlocal leads and doing multiple requests tend to have a lot of duplicates across different requests.

I’m getting this error even when I batch just 200 queries.

I tried using the npm package as well to perform this but I’m getting the same error message.

How do I fix it?

hi @Vishak_Bhaskar,

The problem is with the URL size limit. To overcome this you can use POST request with similar parameters inside a JSON payload.

Example:

curl -X POST https://api.app.outscraper.com/maps/search-v3 -d '{"query": ["restaurants Manhattan NY USA"], "limit": 3, "async": false}' -H "Content-Type: application/json" -H  "X-API-KEY: YXV0aDB8NjAyMDFmODYwOTQ5M2UwMDZhOGM4YjZhfDQ4ODJhYWQ0MjY"

Link to API docs.