Skip to content
Scrappa Get API key
PAP API 1 credit/request

PAP Autocomplete API Documentation

GET https://scrappa.co/api/pap-fr/autocomplete

PAP Autocomplete API turns a place name into the numeric location id that the search endpoint needs. It finds regions, departments, cities and postal codes in France. Each result has the id, the full label such as Courbevoie (92400), the name and the code in brackets. Pass the id as location_id and the label as location_name to the search endpoint.

PAP Autocomplete API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/pap-fr/autocomplete
Auth header
x-api-key
Cost
1 credit/request
query = coffee shops
Response preview
200 OK
{
    "data": {
        "items": [
            {
                "id": 43590,
                "code": "69",
                "name": "Lyon",
                "label": "Lyon (69)"
            }
        ],
        "query": "lyon"
    },
    "meta": {
        "billable": true,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

1 optional filter available.

query string Required

Place name or postal code, 2 to 100 characters. Example: lyon.

Example value coffee shops
limit integer Optional

Number of results, 1 to 25, default 10.

Example value 10

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "items": [
            {
                "id": 43590,
                "code": "69",
                "name": "Lyon",
                "label": "Lyon (69)"
            }
        ],
        "query": "lyon"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A parameter is missing or outside its allowed values. This response is not billable.

{
    "errors": {
        "location_id": [
            "The location id field is required."
        ]
    },
    "message": "The request validation failed"
}
503

Upstream Unavailable

PAP could not be reached, or the page could not be confirmed as the requested one. Retry shortly. This response is not billable.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "autocomplete"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "PAP could not be reached. Please retry shortly."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.