How to Fetch Reviews for a List of Locations in One API Request
You've got a spreadsheet of multiple store addresses, and someone wants to know what customers are saying about every one of them, on Google, Facebook or review sites.
The platforms' own APIs won't get you far. Firing off hundreds of separate requests and chasing their results isn't much fun either.
There's a way shorter, easier way. Find the review page for each location, loop through those URLs to build one JSON payload, and send it once to a bulk endpoint. Each location becomes its own job with its own job ID. Hold on to those IDs, and the reviews land at your callback URL as each job finishes.
This guide shows you how to do that with Datashake's Reviews API and Location Search API. It dives into the code, edge cases, which errors you can fix with a retry, and how to keep the data fresh without collecting everything again.
Let’s dive right in ⬇️
Why can't you get reviews for multiple locations from Google or Facebook's own APIs?
Google and Meta's official APIs aren't built to collect reviews in bulk across many locations, and most of them need owner access:
- Google Places API: returns a maximum of 5 reviews per place.
- Google Business Profile API: gives the full review history for up to 50 locations per call, but only for verified locations you manage.
- Facebook: Meta deprecated Page recommendations in Graph API v22.0, so there's no longer an official API for Facebook reviews.
So for locations you don't own, such as competitors or clients without owner access, none of these APIs gives you the full review history. Here's how they compare:
If you're trying to answer a question about 200 locations across several review sites, that's four integrations, four sets of credentials, and at least two platforms that won't give you the data at all.
Do you own every location? Then start with Google's API
If every location is verified in one Business Profile account, and Google reviews are all you need, batchGetReviews is a fair choice.
It stops being enough when:
- Your locations are spread across franchisees or several accounts, and getting access to each one is its own project
- You need locations you don't manage, such as competitors, prospects, or clients who haven't given you owner access
- You need more than Google, with every review in one schema you can query
How does Datashake get reviews for multiple locations?
Datashake is a review and social data API. Instead of going through each platform's official API, it collects the reviews that are publicly available on a location's review pages, and returns them to you in one consistent format, whichever site they came from. When a site changes, that's handled on Datashake's side, so your code doesn't have to change with it.
That removes the following problems:
- Skip owner access. Pull reviews from public review pages, and treat your own stores, a franchisee's and a competitor's in exactly the same way.
- Get every public review, not five or three. Collect all the reviews each page shows publicly, with ratings, dates, text and the owner's reply where there is one (Reviews API).
- Work with one schema across every site. Every review carries a stable datashake_review_uuid_v2, so you can merge sources and remove duplicates without writing a parser for each platform.
- Let Location Search find the pages. Send a business name and address to the Location Search API and get its review pages back, so you can start without a single URL.
- Submit your whole list at once. Send every review page to the bulk endpoint in one request, and let the Scheduling API rerun it daily, weekly or monthly.
In practice, it comes down to two APIs and one request. Here's how that request works.
How does a bulk reviews request work?
You send one POST request containing a list of up to 200 review pages. Each page becomes a separate job with its own job ID, and you get all the IDs back in the response straight away. The bulk endpoint takes the same fields per item as a single request, and if one item has a problem, the rest still go ahead.
The collection itself happens in the background. Depending on how many reviews a page has, a job can take anywhere from a few minutes to a few hours. That's why every request is asynchronous: you don't wait on an open connection, you get a callback when each job is done.
Every review comes back in the same schema whichever site it came from, with a stable datashake_review_uuid you can use to spot duplicates across jobs.
Before you start: three things to set up
1. Keep your API key out of your code
Store the key in an environment variable or a secrets manager, and send it in the x-api-key header with every request. Never put it in the URL: keys in URLs end up in server logs. If the key is missing or wrong, you'll get 401 Unauthorized (authentication).
2. Make sure your calls don't block the rest of your app
Results arrive later, so there's nothing to wait for. Submit the request, store the job IDs and move on.
If you're calling from a web app, run it in a background task or a queue, so a slow network call never holds up a user's request.
3. Have a callback URL ready
Every job needs one. Your callback must be a public URL that accepts POST requests and replies quickly with a 2xx status (receiving results). localhost and private IP addresses won't work. When you're testing locally, expose your endpoint with a tunnelling tool, or point the callback at a request-inspection service to see exactly what gets sent.
Your base URLs appear in your dashboard next to your API key. The examples below read them from environment variables:
Step 1: Find the review pages for every location
If you already have the review page URLs, skip to step 2.
If you don't, this is the part that usually eats the most time. Matching 200 store addresses to their pages on several review sites by hand means hundreds of searches, plus a lot of checking.
The Location Search API does the matching for you. Send a business name and as much of the address as you have, and it returns the matching review pages, grouped by location and ready to pass to the Reviews API. It works best for businesses with a physical address, such as hotels, shops and clinics.
Here's a search for Burger King review pages in Paris:
You get 201 Created and a request_id straight away. When the search is done, the first page of results is POSTed to your callback (find a business's review pages).
To get the rest, request the next page with GET /results/{request_id}?page=2. Each page arrives at your callback the same way, and extra pages don't use credits. To see how far a search has got, call GET /requests/{request_id}/status, which returns completeness_rate, success_rate and the number of results found so far (search status).
How do you find review pages for a list of store addresses?
Send one Location Search request per store, with the address split into separate fields and your own store ID attached:
- Split the address into street, city, zip_code and country. If you only have it on one line, use address instead.
- Add the business details: the name, and the website domain if you have it.
- Pass your store ID as external_identifier. It comes back with the results, so each set of review pages maps straight to the right store, with no lookup table needed.
For a single store, that looks like this:
Loop through your store list to send one request per row. All the parameters are listed under find a business's review pages.
How do you get accurate matches?
There's a trade-off: the more details you send, the more accurate the matches, but the fewer you'll get. Send less and you'll get more results, including some that aren't quite right. A few habits help:
- Use the official business name. "Chipotle Mexican Grill", not "Chipotle".
- Use min_ranking. Every result has a ranking that shows how closely it matches what you sent. The default threshold is medium. Raise it for a clean store list, and lower it when you're exploring.
- Limit the sites with review_site if you only need some sources.
- Expect gaps. Anything that can't be found comes back as null.
Step 2: Loop through the URLs to build the payload
The bulk endpoint takes a JSON array with one object per review page. Each object needs a url and a callback. Add external_identifier (up to 255 characters) to carry your own store ID through to the results (add a review page).
This is where the loop comes in. You still loop through your locations, but only to build the payload. The request itself goes out once.
Use the main review page, not a link to a single review. Sites format their links differently, and a link to one review won't be accepted.
Don't combine from_date and diff in the same item. Use from_date to limit history on a first run, and diff for refreshes (more on that below).
Step 3: Send one bulk request
POST the array to /api/v2/profiles/add_bulk:
Check success on every item, not just the HTTP status. If one item has a problem, the others still go ahead, so a 200 on the request doesn't mean every location was queued (add review pages in bulk).
In Python, with retries for the errors that a retry can actually fix:
For a long list, split it into batches and send one bulk request per batch.
How many locations can you send in one bulk request?
Up to 200 items per request. For a longer list, split it into batches of 200 and send one bulk request per batch:
So 200 stores is a single request, and 1,000 stores is five.
Step 4: Store every job ID
Every item you submit gets a job ID that's unique to you and to that job. Store each one against your store ID, because you'll need it for three things:
- Finding a location's results again. You can re-fetch a job's reviews by its ID.
- Refreshing later. A refresh that only collects new reviews needs the previous job's ID.
- Getting help. If something looks wrong, the job ID is what lets anyone trace exactly what happened (limits and errors).
This matches results to your stores by URL rather than relying on the order they come back in, and it keeps a list of anything that wasn't queued so you can fix and resubmit just those.
Lost track of some IDs? List your jobs with GET /api/v2/profiles/jobs, filtered by from_created_at or crawl_status. Jobs are only kept for a limited time, though, so store the results on your side rather than treating the API as an archive.
Step 5: Get the results
When a job reaches a final status (complete, failed or invalid_url), the job details and the reviews are POSTed to your callback (receiving Reviews results). A trimmed example:
Write a callback handler that's safe to call twice
Two rules make a callback handler reliable:
- Acknowledge first, process afterwards. Reply with a 2xx as soon as the request arrives, then do the database work in the background. It's the standard pattern for webhooks, and it stops a slow insert from timing out the delivery.
- Make it idempotent. The same reviews can reach you more than once: a delivery gets retried, or a full refresh overlaps an earlier job. Upsert on datashake_review_uuid, which stays the same for a review across jobs (review schema), and duplicates simply update the existing row.
An in-process queue is fine for a prototype. In production, hand the payload to whatever queue you already run.
Secure your callback and handle large pages
Add a callback_parameters object to each item to send your own headers, query_params or a custom_api_key_header with every callback, so your endpoint can check the request really came from Datashake. For pages with thousands of reviews, reviews_chunk_size splits the reviews across several callbacks.
How to fetch results again by job ID
Your callback gets everything when a job finishes. To fetch it again later:
- GET /api/v2/profiles/info?job_id=… returns progress and the page's totals (get page details)
- GET /api/v2/profiles/reviews?job_id=…&allow_response=true returns the reviews with owner replies, up to 100 per page (get reviews)
Two things that could catch you out. ⬇️
First, percentage_complete compares the reviews collected with the total the page shows, and some sites don't show every review publicly, so a complete job can finish below 100%.
Second, on some sites review text includes basic HTML, such as line breaks, so strip or render it before analysis.
Which errors should you retry?
Resending a request with a bad key or a missing field just fails again, and every extra attempt adds load for nothing. Read the error first, then decide.
When you do retry, back off exponentially and add jitter, so a batch of clients doesn't retry in lockstep. Cap the number of attempts as well (AWS Builders' Library). The post_with_backoff function in step 3 does this for 429 and 5xx responses only.
What if the bulk request times out?
A bulk request creates jobs. If it reached the server and only the response got lost, sending the same payload again can queue every location twice and use credits twice. Before resubmitting after a timeout, list your jobs created since the attempt and check what actually went through.
Whatever happens, log the request_id or job_id from every response. It's the fastest way to get an answer if you need to ask Datashake's team about a specific job.
How do you keep the data fresh without collecting everything again?
Use a diff job. Pass the ID of a location's last job as diff, and only reviews posted since that job are collected. The simplest set-up runs in two stages:
- Once per page: a full job, which collects every review the page shows. Add from_date if you only need reviews after a certain date.
- Then on repeat: a diff job referencing your latest completed job for that page.
In the bulk payload, that's one extra field per item:
Use a recent job as the reference, because jobs are only kept for a limited time.
What diff jobs don't catch
A diff picks up new reviews. It doesn't pick up edits to older reviews or deletions (add a review page), and new owner replies to old reviews won't come through either. If those matter, run a full job every so often. Because you're upserting on datashake_review_uuid, the full run updates existing rows instead of creating duplicates.
How often should you refresh?
It depends on what the data is for, and more often isn't automatically better:
- Daily if you alert on negative reviews or have a target for replying to them
- Weekly for operational reporting across locations
- Monthly for research, benchmarking and trend analysis, where a few weeks' delay doesn't change the answer and the lower volume of jobs keeps costs down
Let the Scheduling API run it for you
The Scheduling API reruns Reviews and Location Search requests daily, weekly or monthly, so you don't have to maintain a scheduler. Scheduling itself is free: you only use credits for the jobs it creates. A few things to know before you rely on it:
- Your API key is added to scheduled requests for you, but each request still needs a callback
- A schedule pauses itself if a run fails 10 times in a row or you run out of credits. Restart it by updating the schedule
- You can rename, pause and restart a schedule, but you can't change what it runs. To change the request, delete the schedule and create a new one
Try it with your own locations
Pick five locations, run them through the steps above, and see what comes back at your callback. Start your free trial: 20 free searches, no card needed.
Frequently asked questions
How do I get more than 5 Google reviews through an API?
Google's Places API returns a maximum of 5 reviews per place. To get the full history you need either Google's Business Profile API, which only covers verified locations you manage, or a review data API that collects every publicly available review from the page.
Can I get reviews for locations I don't own or manage?
Not through the platforms' official APIs, which need owner access (Google Business Profile) or no longer serve the data at all (Facebook). The Reviews API works from public review pages, so it doesn't need owner access. That's what makes competitor benchmarking and agency work possible. It only returns reviews that are publicly available.
Can I still get Facebook reviews through Meta's API?
No, Meta deprecated Page recommendations in Graph API v22.0, and reading them now returns error code 12. Page ratings webhooks are no longer sent either.
Is there a rate limit on the Reviews API?
Yes. There's a limit on requests per second and on how many jobs can run at once, and both depend on your plan. Go over either and you'll get 429 Too Many Requests. Wait briefly and try again (limits and errors). Bulk requests help here, because one request covers many locations.
How long does a reviews job take?
From a few minutes to a few hours, mostly depending on how many reviews the page has. Track a job with GET /api/v2/profiles/info, or simply wait for the callback.
How do I avoid duplicate reviews?
Upsert on datashake_review_uuid. It's a stable ID for each review that stays the same across jobs, so repeat deliveries and overlapping full refreshes update the same row instead of adding a new one.
Why do some Google review dates look approximate?
Google shows many review dates in relative terms, such as "3 days ago". The exact date is calculated from the time of collection, so dates on older reviews are less precise. Bear that in mind if you report on narrow time windows.
What format does the review data come in?
JSON, in one schema for every site: rating, date, title, text, language, the reviewer's public details, the owner's reply where there is one, and stable IDs for the review and the page. Results from dashboard jobs can be exported as CSV.
How much does it cost?
You can try it with 20 free searches, on any source, with no card needed. Plans start at $99 a month after that, and your account's full docs list how many credits each type of request uses.
