# Apify Local Business Leads (`abdou_009/apify-local-business-leads`) Actor

- **URL**: https://apify.com/abdou_009/apify-local-business-leads.md
- **Developed by:** [Abdelkader BENAISSI](https://apify.com/abdou_009) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 lead scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-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

## Local Business Leads

Find **local businesses** for any search query + location — name, category, address, coordinates, phone, website and opening hours — using **free OpenStreetMap data** over plain HTTP. No headless browser, no API key, no per-request fees.

Feed it a query like `coffee shop` and a location like `Algiers, Algeria`, and get back one dataset row per business lead, ready to drop into a CRM, an outreach list, or an AI agent's research step.

### How it works

1. **Geocode** — your location text is resolved to a bounding box via OpenStreetMap Nominatim (respecting its usage policy: max 1 request/second, proper User-Agent).
2. **POI search** — the Overpass API is queried for points of interest inside that bounding box. Common query words map to OSM tags (`coffee` → `amenity=cafe`, `hotel` → `tourism=hotel`, `pharmacy` → `amenity=pharmacy`, …); anything else falls back to a case-insensitive search over business names and tags.
3. **Normalize** — each result becomes a clean lead: name, `amenity=cafe`-style category, composed street address, city, country, latitude/longitude, phone, website, opening hours, plus the OSM element type/id for traceability.

Because it's pure HTTP against free APIs, a search costs essentially nothing to run.

### Input

| Field | Description |
|---|---|
| `query` | What kind of business to find, e.g. `coffee shop`, `restaurant`, `hotel`, `pharmacy`, `gym` (required) |
| `location` | Where to search, e.g. `Algiers, Algeria`, `Austin, Texas` (required) |
| `maxResults` | Max leads to return (default 20, up to 200) |

Example input:

```json
{
  "query": "coffee shop",
  "location": "Algiers, Algeria",
  "maxResults": 20
}
```

### Output

One dataset row per business lead:

| Field | Description |
|---|---|
| `name` | Business name (when tagged in OSM) |
| `category` | Category as OSM tag, e.g. `amenity=cafe` |
| `address`, `city`, `country` | Address composed from OSM `addr:*` tags |
| `latitude`, `longitude` | Coordinates |
| `phone`, `website`, `openingHours` | Contact details and hours (when tagged) |
| `osmType`, `osmId` | OpenStreetMap element type and id |

### Pricing

| Event | Price |
|---|---|
| Lead scraped | **$0.002** per business lead successfully scraped |

You are only charged for leads that are actually delivered — failed searches cost nothing. (Apify platform usage costs are paid by you as usual.)

### Data note

All business data comes from **OpenStreetMap**, the free community map of the world. Coverage and detail vary by area: dense city centers tend to have rich listings, rural areas sparser ones. Fields like phone, website and opening hours are only present when OSM contributors tagged them.

# Actor input Schema

## `location` (type: `string`):

Where to search, e.g. a city, region or address. Geocoded via OpenStreetMap Nominatim.

## `maxResults` (type: `integer`):

Maximum number of business leads to return.

## `query` (type: `string`):

What kind of business to find (e.g. coffee shop, restaurant, hotel, pharmacy, gym).

## Actor input object example

```json
{
  "location": "Algiers, Algeria",
  "maxResults": 20,
  "query": "coffee shop"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset with one row per business lead: name, category, address, coordinates, phone, website and opening hours.

# 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 = {
    "location": "Algiers, Algeria",
    "query": "coffee shop"
};

// Run the Actor and wait for it to finish
const run = await client.actor("abdou_009/apify-local-business-leads").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 = {
    "location": "Algiers, Algeria",
    "query": "coffee shop",
}

# Run the Actor and wait for it to finish
run = client.actor("abdou_009/apify-local-business-leads").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 '{
  "location": "Algiers, Algeria",
  "query": "coffee shop"
}' |
apify call abdou_009/apify-local-business-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,abdou_009/apify-local-business-leads"
        }
    }
}
```

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/3oahubT6j39A52WKv/builds/z8Omi8ByesTVI0Er4/openapi.json
