# Gumtree Location API Documentation

Find the nearest Gumtree UK location (postcode or area) for a latitude and longitude. The returned id and type feed location_id and location_type of the search endpoint. Coordinates without a nearby UK location return a not billable 404.

- **Documentation:** [https://scrappa.co/docs/gumtree-api/gumtree_location](https://scrappa.co/docs/gumtree-api/gumtree_location)
- **API group:** Gumtree API
- **Endpoint:** `GET https://scrappa.co/api/gumtree/location`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `latitude` | number | Yes | Latitude, -90 to 90. Example: 53.48. |
| `longitude` | number | Yes | Longitude, -180 to 180. Example: -2.24. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/gumtree/location?latitude=53.48&longitude=-2.24"
```

## Example response

```json
{
    "success": true,
    "data": {
        "location": {
            "id": "895643",
            "name": "M14HD",
            "type": "POSTCODE",
            "latitude": 53.48,
            "longitude": -2.23981
        }
    },
    "meta": {
        "endpoint_family": "location",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid. This response is not billable. |
| 404 | Resource Not Found | No Gumtree location lies near these coordinates. This response is not billable. |
| 502 | Invalid Source Response | The upstream answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Service Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
