# Google LSA Coverage Audit (`latentlark/lsa-coverage-audit`) Actor

Audit bulk Google Local Services Ads exports before client handoff. Compare planned searches with actual rows, separate empty searches from failures or missing coverage, and see which searches to review or rerun. Free synthetic demo; $0.25 per completed report.

- **URL**: https://apify.com/latentlark/lsa-coverage-audit.md
- **Developed by:** [LatentLark](https://apify.com/latentlark) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$250.00 / 1,000 coverage reports

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google LSA Coverage Audit

A LatentLark Apify Actor for agencies and data teams that hand off bulk Local Services Ads exports. It compares a finished LatentLark LSA run with the original list of searches and separates **reported empty**, **failed**, **missing**, and **uncertain because of deduplication**. It does not collect ads, change your source Actor, send outreach, or start a retry.

### Try it

Run the Actor with `{}` for a synthetic demo report in Storage → Key-value store → OUTPUT (no report event). To check a real export from the [LatentLark Google LSA Scraper](https://apify.com/latentlark/google-local-services-ads), open its finished run. Copy the dataset ID from **Storage → Dataset** and use the original services, locations, and dedupe setting from **Input**:

```json
{"datasetId":"YOUR_DATASET_ID","sourceInput":{"services":["plumber"],"locations":["78701"],"dedupe":true}}
```

This path grants the audit read-only access to the selected dataset, not your whole account. You can also supply inline `rows` with `sourceInput`. Use one source only. The advanced run-ID lookup requires permissions not included in the default deployment. See [the demo input](examples/demo.json) for the shape of the inline input; passing the file explicitly is treated as a regular audit, not the free demo.

For a real audit, the output dataset contains one JSON report. Use `decision` to decide whether to hold a batch, `checks` to see the status of each search, and `rerunCandidates` to review only missing or failed pairs. Rerun pairs individually or group them carefully: taking the cross product of listed services and locations may repeat successful searches.

- `reported_empty`: the upstream export explicitly reported no results for that search.
- `failed` / `missing`: fix upstream errors or limits before retrying.
- `unverified_dedupe`: there is no row; cross-search dedupe may be why. Verify before paying for another search.
- `conflicting` / `over_expected_cap`: double-check that the export is from one run and uses the original input.
- `providers_seen`: the export has provider rows. This is not a guarantee of complete capture or of advertiser presence outside the observed run.

This Actor supports up to 300 planned searches and 30,000 source rows. It outputs no provider names, websites, or phone numbers. If you paste source records directly, keep in mind that Apify still stores Actor inputs. Prefer a dataset ID and private storage.

### Pilot pricing

**$0.25 per completed report.** There is no separate startup fee. The synthetic demo is free; open **Storage → Key-value store → OUTPUT** after a demo run. Audit reports for your own data appear in the run’s output dataset.

Local development: `python -m pip install -r requirements.txt`; `python -m unittest discover -s tests -v`; run the Actor with `python -m src`. Use `ACTOR_TEST_PAY_PER_EVENT=true` to test event calculation locally without billing.

# Actor input Schema

## `datasetId` (type: `string`):

The existing scraper run’s dataset ID. This grants access to this dataset only. Use with Original input.

## `sourceInput` (type: `object`):

Required with Dataset ID or Source rows. Include services, locations and original dedupe setting.

## `rows` (type: `array`):

Dataset items. Use with Original input only.

## `sourceRunId` (type: `string`):

Run ID lookup requires permissions the default Actor doesn’t have. Use the dataset ID for private or limited-permission runs.

## Actor input object example

```json
{}
```

# Actor output Schema

## `report` (type: `string`):

One coverage report with evidence counts and searches to review or retry.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("latentlark/lsa-coverage-audit").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("latentlark/lsa-coverage-audit").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call latentlark/lsa-coverage-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,latentlark/lsa-coverage-audit"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tB1020C6oJGk8N60d/builds/XVHQGpmlQJ3JxSBeL/openapi.json
