This page explains how to use our API to search for businesses across multiple industries and locations, filter the results and audit selected businesses.
All requests to our API should be authenticated. Our API is RESTful and communicates using JSON.
How a Prospect Discovery search works
Prospect Discovery searches run in the background. Starting a search returns a search id, which you can use to fetch its status and results.
The process has three steps:
Start a search using your chosen industries and locations.
Fetch the results every few seconds until the search finishes, applying any filters you need.
Start audits for the businesses you want to analyse.
A search moves through these statuses: pending → running → complete. Its status will be failed if it could not be completed.
Searches do not use credits. Audits use one report credit each.
Start a new search
Method: POST
Endpoint: https://api.insites.com/api/v1/prospect-searches
Request body should be JSON encoded, and can include the following fields:
Property | Definition | Required |
| Array of strings – Industries to search for, e.g. | Yes |
| Array of strings – Locations to search in, e.g. | Yes |
| Integer – Maximum number of businesses to collect, from 1 to 200. Defaults to 200. A smaller limit allows the search to finish sooner. | No |
| String – Language code used to look up locations, e.g. | No |
Each industry is searched in each location, up to a maximum of 25 industry and location combinations. The search can collect up to 200 businesses in total.
You can also include an optional Idempotency-Key header to prevent retries from creating duplicate searches. See Idempotency below.
Example
curl --request POST "https://api.insites.com/api/v1/prospect-searches" \ --header "api-key:[YOUR API KEY]" \ --header "Content-Type: application/json" \ --data '{ "industries": ["plumbers"], "locations": ["Leeds"], "limit": 50 }'
Expected response
If successful, you would expect a 202 response containing the search id.
The response also includes a Location header pointing to the search, which can be used when polling.
Fetch a search and its results
Method: GET
Endpoint: https://api.insites.com/api/v1/prospect-searches/[ID]
Returns the search status and any results collected so far.
While the search is in progress, the API returns a 202 response. Once the search has finished, it returns a 200 response.
If a location cannot be found, it is listed in locations_not_found. The search continues for the remaining locations.
Example
curl "https://api.insites.com/api/v1/prospect-searches/[ID]" \ --header "api-key:[YOUR API KEY]"
Filtering results
You can include the following optional query parameters when fetching a search:
Property | Supported values | Definition |
|
| Whether the business has a website. |
|
| Whether the business has a phone number. |
|
| Whether the business has an address. |
|
| Whether the business has photos. |
|
| Whether the business has UTM tracking. |
|
| Whether the Google Business Profile is claimed. |
| Comma-separated Google categories, e.g. | Businesses matching any of the supplied categories. |
|
| Filter by rating. |
|
| Filter by review count. |
|
| Filter by organic Google position. |
|
| Whether the business has already been audited by your account. |
Filters are combined using AND. For example, using website=has and claimed=unclaimed returns businesses that have a website and an unclaimed Google Business Profile.
If none of the results contain the data needed for a filter, that filter is skipped and listed under filters.ignored. Check this field to confirm which filters were applied.
Example with filters
This request returns businesses with a website and an unclaimed Google Business Profile that have not already been audited by your account:
curl "https://api.insites.com/api/v1/prospect-searches/[ID]?website=has&claimed=unclaimed&analysed=no" \ --header "api-key:[YOUR API KEY]"
Result data
Each business result includes the following fields:
Property | Definition |
| The business’s place ID. Use this when requesting an audit. |
| Business name. |
| Business website. |
| Phone number. |
| Business address. |
| Business coordinates. |
| Business category. |
| Business rating. |
| Number of reviews. |
| Whether the Google Business Profile is claimed. |
| Whether photos are present. |
| Whether UTM tracking is present. |
| Organic Google ranking positions. |
| Your account’s latest audit for this business, or |
| The industry and location searches that found the business. |
The response also includes:
Property | Definition |
| Total number of businesses collected before filtering. |
| Number of businesses matching the applied filters. |
| Filters applied to the results. |
| Filters skipped because the required data was unavailable. |
The report_id is checked each time you fetch the results, so it reflects the latest audit associated with the business in your account.
Expected responses
Code | Reason |
| The search has finished. Check |
| The search is still in progress. Results collected so far are included. |
| The search was not found for your account. |
There is no webhook for search completion. Fetch the search every few seconds until its status is complete or failed.
Audit selected businesses
Method: POST
Endpoint: https://api.insites.com/api/v1/prospect-searches/[ID]/audits
Starts audits for selected businesses from the search, using the same process as Analyse in the app.
Request body should be JSON encoded and include the following field:
Property | Definition | Required |
| Array of strings – Place IDs of the businesses to audit. Maximum of 200. | Yes |
Each audit uses one report credit. If your account does not have enough credits for the batch, the whole batch is refused.
Example
Replace the example place IDs with values returned by your search.
curl --request POST "https://api.insites.com/api/v1/prospect-searches/[ID]/audits" \ --header "api-key:[YOUR API KEY]" \ --header "Content-Type: application/json" \ --data '{ "place_ids": ["[PLACE ID 1]", "[PLACE ID 2]"] }'
Expected response
If successful, you would expect a 202 response containing queued and skipped information.
Skipped businesses include their place_id and a reason:
Reason | Definition |
| The business is not part of this search. |
| The business has no website and your account does not support auditing without one. |
As each audit gets under way, its report_id appears in the search results. You can then use the Audit API to check its status and fetch the audit data.
Idempotency
To make retries safe, send an Idempotency-Key header when starting a search or requesting audits.
--header "Idempotency-Key:[UNIQUE REQUEST KEY]"
If we receive a repeated request carrying the same key within 24 hours, we return the original result instead of creating a duplicate request.
Use a new key for each distinct request. When retrying the same request, reuse its original key.
If a request with the same key is still being processed, the API returns 409 with the code request_in_progress. Retry shortly afterwards.
Limits
Maximum of 5 industries and 5 locations per search.
Maximum of 200 businesses per search.
Maximum of 200 place IDs per audit request.
API keys are rate limited to 120 requests per minute.
Searches do not use credits. Each audit uses one report credit.
Errors
Errors return problem-details JSON containing a code that your integration can check.
Code | Error | Reason |
| Authentication error | The API key is invalid. |
|
| Your account does not have enough credits for the requested audits. |
|
| The search was not found for your account. |
|
| A request using the same idempotency key is still being processed. Retry shortly afterwards. |
|
| One or more fields are invalid. The |
|
| There are no businesses eligible to audit in the request. |
