Find local businesses from Google Maps with Local Business Data API
OpenWeb Ninja's Local Business Data API finds businesses on Google Maps from a text query and returns each one with a business_id, which opens the business's opening hours, rating breakdown and reviews. Each call is one request at $0.03 per 10 requests, drawn from a plan your credential holds, so a search plus one business's details and reviews is three requests, or $0.009. Send GET https://agents.openwebninja.com/zcj/9yju1zcg6cx7/local-business-data/search with Authorization: Bearer <token>.
At a glance
- Endpoints:
GET https://agents.openwebninja.com/zcj/9yju1zcg6cx7/local-business-data/search,/local-business-data/business-detailsand/local-business-data/business-reviews-v2 - Request: query parameters only.
queryis required on search, andbusiness_idis required on details and reviews.fieldsnarrows the response. - Price: $0.03 per 10 requests. Each call is one request.
- Payment: each call draws on a plan your credential holds, Credits or Free. There is no per-call payment.
- Credential:
Authorization: Bearer <token>, an agent identity the storefront issues for free. No upstream API key is needed. - Response: JSON with
status,request_id,parametersanddata. - Limits: search takes
limitfrom 1 to 500, with a default of 20. Reviews takelimitfrom 1 to 100, with a default of 20, and page withcursor. - Full purchase flow: the buyer skill
Find a business, then read its hours and reviews
Search by query. Use
fieldsto keep only what you read:curl -sG "https://agents.openwebninja.com/zcj/9yju1zcg6cx7/local-business-data/search" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ --data-urlencode "query=coffee shops in Austin, TX" \ --data-urlencode "limit=3" \ --data-urlencode "fields=business_id,name,full_address,rating,review_count"The response is a JSON object whose
datalists the businesses, each withbusiness_id,name,full_address,ratingandreview_count. This request drew $0.003 from credit. The first result:{ "status": "OK", "data": [ { "business_id": "<business_id>", "name": "Epoch Coffee", "full_address": "Epoch Coffee, 221 W N Loop Blvd, Austin, TX 78751", "rating": 4.5, "review_count": 2536 } ] }Pass a
business_idto business-details for its hours and how its ratings break down:curl -sG "https://agents.openwebninja.com/zcj/9yju1zcg6cx7/local-business-data/business-details" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ --data-urlencode "business_id=$BUSINESS_ID" \ --data-urlencode "fields=business_id,name,working_hours,reviews_per_rating,subtypes,price_level"working_hoursis keyed by weekday, andreviews_per_ratinggives the number of reviews for each star from 1 to 5. This request drew $0.003 from credit. An excerpt:{ "working_hours": {"Monday": ["12 AM-11:30 PM"], "Tuesday": ["Open 24 hours"]}, "reviews_per_rating": {"1": 84, "2": 60, "3": 150, "4": 462, "5": 1780}, "subtypes": ["Coffee shop"] }Pass the same
business_idto business-reviews-v2 for its reviews:curl -sG "https://agents.openwebninja.com/zcj/9yju1zcg6cx7/local-business-data/business-reviews-v2" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ --data-urlencode "business_id=$BUSINESS_ID" \ --data-urlencode "limit=3"The example returned
data.reviews, a list of three reviews, and adata.cursorstring, and drew $0.003 from credit. Each review carries fields such asreview_id,rating,review_text,review_language,review_datetime_utc,review_time,review_link,review_photos,like_count,review_sourceandreview_form.Fetch the next page by sending the same request with
cursorset to the previousdata.cursor. Each page is one more request. Whendata.cursorisnull, there are no more reviews.
Choose the parameters for the job
| You want | Send |
|---|---|
| Results biased toward a point | lat, lng and zoom on search |
| Only certain categories | subtypes, a comma-separated list such as Plumber,Electrician |
| Only open or verified businesses | business_status=OPEN, verified=true |
| Hours and rating breakdown | fields=working_hours,reviews_per_rating on business-details |
| Newest or lowest-rated reviews first | sort_by=newest or sort_by=lowest_ranking |
| Reviews that mention a term | query on business-reviews-v2 |
Both business-details and business-reviews-v2 accept a google_id, business_id or place_id as business_id.
Search from coordinates or an area
The service also finds businesses inside an area, a bounding box or a radius, or near a point. Each of these is its own route at the same price per request: /local-business-data/search-in-area, /local-business-data/search-nearby, /local-business-data/area-search-by-radius and /local-business-data/area-search-by-bounding-box. Their parameters are in the service's API reference, https://agents.openwebninja.com/zcj/9yju1zcg6cx7/services/local-business-data/openapi.json, which is free to read.
What is charged, and when
- Every call needs a credential that holds a plan. Without a bearer token, a call answers
401. With a token but no covering plan, it answers403. Neither of these draws any credit. - Reading the manifest and the API reference costs nothing. Buying Credits answers with a 402 price quote, and nothing is charged until you pay it; the buyer skill has the steps.
- Each paid response carries a
zc-billingheader, and itschargedUsdfield shows what that request debited.
Errors
| Response | Meaning | Action |
|---|---|---|
401 bearer_required | No agent credential was sent | Register at auth.md, then retry with the bearer token |
401 invalid_token | The token expired or did not verify | Exchange your stored assertion for a fresh token |
403 plan_required | No plan you hold covers the call | Buy one of the plans listed in the body, then retry |
403 verified_email_required | The Free plan needs a claimed credential | Have your human claim the credential, or buy Credits |
usage_exhausted | Your credit is used up | Top up with POST https://agents.openwebninja.com/zcj/9yju1zcg6cx7/extend and {"amountUsd": "..."} |
503 | A temporary error. It is not billed. | Retry with bounded backoff |
Frequently asked questions
Does the Local Business Data API need an API key?
No upstream API key is needed. You call the storefront with a bearer token for the agent identity it issues, and registering that identity is free. The token must belong to a credential that holds the Free plan or Credits.
How much does a Google Maps business search cost?
Each call is one request at $0.03 per 10 requests. A search, one business's details and one page of its reviews add up to three requests, or $0.009.
How do I get every review for a business?
Call business-reviews-v2 with limit up to 100. Then repeat the call with cursor set to the last data.cursor until it comes back null. Each page is a separate request.
Can I pay for a single call without a plan?
No. This storefront has no per-call payment, so every call draws on a plan held by your credential. To get a plan, buy Credits or claim the Free plan.
Can I find businesses near a set of coordinates?
Yes. Search accepts lat, lng and zoom to bias results toward a point. The service also has dedicated area, bounding-box, radius and nearby searches, which are listed in its API reference.
Keep reading
- Buyer skill: the full purchase flow
- Identity: register and exchange a credential
- How to pay: plans, rails and top-ups
- Local Business Data service page: price and plans
- Error reference: every error code