# FichierFrais Maps Engine (privé) (`fit_melon/fichierfrais-maps-engine`) Actor

- **URL**: https://apify.com/fit\_melon/fichierfrais-maps-engine.md
- **Developed by:** [D N](https://apify.com/fit_melon) (community)
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 results

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/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## FichierFrais Maps Engine (privé)

Moteur de production FichierFrais — scraping Google Maps durci pour tenir plusieurs
milliers de prospects/semaine. Clone privé de `free-google-maps-scraper-ii`, renforcé.

### Ce qui a été durci par rapport à l'actor II

- **Timeout réseau strict** (25 s) sur chaque requête Maps — plus de socket qui pend.
- **Parallélisme** : termes de recherche ET tuiles traités en parallèle, sous un
  limiteur global (`searchConcurrency`, défaut 4).
- **Push incrémental** : chaque page de 20 résultats est enrichie puis poussée
  immédiatement au dataset. Rien ne reste en mémoire.
- **Enrichissement accéléré** : les pages contact/légales d'un site sont
  récupérées en parallèle (au lieu d'une par une), avec un agent HTTP keep-alive
  partagé (connexions TCP/TLS réutilisées) et visite des sites en direct (pas de
  hop proxy). Mesuré −37 % de temps et −39 % de coût sur un run d'enrichissement,
  avec plus d'emails trouvés, pas moins.
- **Checkpoint / reprise** : l'état (fiches poussées, termes/cellules terminés,
  cache géo) est persisté. Une migration Apify ou un *resurrect* reprend où on
  en était, sans doublons.
- **Throttling adaptatif** : cooldown global qui double à chaque blocage Google
  détecté et décroît après une série de succès. 100 % gratuit (pas de proxy
  résidentiel).
- **Géocodage robuste** : BAN (api-adresse.data.gouv.fr) pour la France,
  Nominatim en repli, retries + cache persisté.
- **Enrichissement contacts renforcé** : retry + repli `http://`, décodage des
  emails obfusqués Cloudflare (`data-cfemail`, `email-protection#`), entités
  HTML (`&#64;`), formes écrites `[at]`/`[arobase]`/`[dot]`/`[point]`.
- **File de retry** : les cellules échouées (réseau/blocage passager) sont
  rejouées une fois en fin de run.
- **Suivi temps réel** : status message toutes les 15 s + `RUN_STATS` dans le
  key-value store.

### Recette de production (50 000+/semaine)

Lancer plusieurs runs en parallèle (catégories × villes) via
`lancer_production.py`, chacun avec `timeout ≥ 3600`, puis récolter avec
`recolter_scraping.py` (dédoublonnage placeId inter-runs).

Input type d'un run de production :

```json
{
  "searchStringsArray": ["plombier", "électricien", "chauffagiste"],
  "locationQuery": "Lyon, France",
  "maxCrawledPlacesPerSearch": 200,
  "language": "fr",
  "countryCode": "fr",
  "tiles": 3,
  "scrapeContacts": true,
  "searchConcurrency": 4
}
```

Sortie 100 % compatible avec la chaîne existante (`placeId`, `emails`,
`socialProfiles`, `scrapedAt`, …) : `recolter_scraping.py` fonctionne sans
modification.

# Actor input Schema

## `searchStringsArray` (type: `array`):

One or more things to search for on Google Maps, e.g. "coffee shops", "dentist", "hotels". Each term is searched separately.

## `locationQuery` (type: `string`):

Free-text location to center the search on, e.g. "Austin, TX", "Paris, France". Geocoded automatically. Leave empty to rely only on the search term.

## `maxCrawledPlacesPerSearch` (type: `integer`):

Maximum number of places to return for each search term (across all tiles). Results are paginated in pages of 20.

## `startUrls` (type: `array`):

Optional. A list of Google Maps place URLs (e.g. https://www.google.com/maps/place/...) to scrape directly. Great for enriching an existing list.

## `placeIds` (type: `array`):

Optional. A list of Google Maps CIDs (numeric) to resolve directly.

## `categoryFilterWords` (type: `array`):

Keep only places whose category contains one of these words (case-insensitive), e.g. "restaurant", "bar". Leave empty to keep all.

## `placeMinimumStars` (type: `string`):

Keep only places with a rating >= this value (e.g. "4.0"). Leave empty for no minimum.

## `onlyWithWebsite` (type: `boolean`):

Skip places that have no website.

## `onlyWithPhone` (type: `boolean`):

Skip places that have no phone number.

## `scrapeContacts` (type: `boolean`):

For each place that has a website, visit it and extract e-mail addresses and social media profiles (Facebook, Instagram, LinkedIn, X, YouTube, TikTok). Slower, but great for lead generation.

## `scrapeDetails` (type: `boolean`):

Deep mode (headless browser): fetches the real review count, the full 7-day opening hours and individual reviews. Much slower (~20-30s/place) and best run with more memory (2-4 GB). Leave off for fast runs. Note: Google renders some atypical places incompletely — a few may come back without deep fields.

## `maxReviews` (type: `integer`):

In deep mode, also scrape up to this many individual reviews (author, rating, text, date) per place. 0 = don't scrape review text. Higher values are slower.

## `detailsConcurrency` (type: `integer`):

How many places to process in parallel in deep mode. Headless browser pages are heavy — keep at 1 on small (1-2 GB) runs; raise to 2-3 only with 4 GB+ memory.

## `tiles` (type: `integer`):

Split the area into an N×N grid of sub-searches to exceed Google's ~120-results-per-search limit and get exhaustive coverage. 1 = off (default). Try 3 for a city. Requires a location.

## `language` (type: `string`):

Language code (Google `hl`), e.g. "en", "fr", "es".

## `countryCode` (type: `string`):

Country bias (Google `gl`), e.g. "us", "fr", "gb".

## `latitude` (type: `string`):

Override the map center latitude. If set with longitude, location geocoding is skipped.

## `longitude` (type: `string`):

Override the map center longitude.

## `zoom` (type: `integer`):

Map zoom level. Higher = tighter area around the center. Default 12 (city level).

## `maxRetries` (type: `integer`):

Number of attempts per request before giving up (with exponential backoff).

## `maxConcurrency` (type: `integer`):

How many websites to visit in parallel when 'Enrich with e-mails & social profiles' is on. Higher = faster, but heavier on proxy/compute. Default 10.

## `proxyConfiguration` (type: `object`):

Proxy settings. Recommended for larger runs. You pay only for your own Apify proxy usage; residential proxies (optional) improve success rate at scale.

## `searchConcurrency` (type: `integer`):

Nombre de requêtes Google Maps simultanées (tous termes confondus). 4 par défaut : bon débit sans déclencher de blocage. Réduire à 2 si le taux de blocage monte.

## `tileConcurrency` (type: `integer`):

Tuiles géographiques traitées en parallèle au sein d'un même terme (mode tiles > 1).

## Actor input object example

```json
{
  "searchStringsArray": [
    "restaurants",
    "hotels"
  ],
  "locationQuery": "Lyon, France",
  "maxCrawledPlacesPerSearch": 20,
  "onlyWithWebsite": false,
  "onlyWithPhone": false,
  "scrapeContacts": false,
  "scrapeDetails": false,
  "maxReviews": 0,
  "detailsConcurrency": 1,
  "tiles": 1,
  "language": "fr",
  "countryCode": "fr",
  "zoom": 12,
  "maxRetries": 3,
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "searchConcurrency": 4,
  "tileConcurrency": 2
}
```

# Actor output Schema

## `places` (type: `string`):

All scraped places, one item per business. Each item carries a `status` field (`found`, `not_found` or `error`) so failed lookups are never silently dropped.

## `leads` (type: `string`):

The same dataset rendered through the `leads` view: name, phone, e-mails, website and social profiles — the columns used for prospecting exports.

## `runStats` (type: `string`):

JSON record with the run counters: number of requests, blocked responses, errors, items pushed, breakdown by status and per-field fill rate.

# 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 = {
    "searchStringsArray": [
        "restaurant"
    ],
    "locationQuery": "Lyon, France"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fit_melon/fichierfrais-maps-engine").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 = {
    "searchStringsArray": ["restaurant"],
    "locationQuery": "Lyon, France",
}

# Run the Actor and wait for it to finish
run = client.actor("fit_melon/fichierfrais-maps-engine").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 '{
  "searchStringsArray": [
    "restaurant"
  ],
  "locationQuery": "Lyon, France"
}' |
apify call fit_melon/fichierfrais-maps-engine --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fit_melon/fichierfrais-maps-engine"
        }
    }
}
```

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/9obUVL3chhjKmSMio/builds/67PVufACggWDjgzBA/openapi.json
