# GasBuddy Stations API Documentation

<p><strong>GasBuddy Stations API Documentation</strong> Search fuel stations by ZIP, city or coordinates. Prices are numbers with a currency, ids work unchanged in the station route, dates use ISO 8601 and image URLs are full size. US uses USD per gallon and Canada uses CAD cents per litre. 1 credit per request. Failed and empty results are never billed. An empty result returns a hint with a city and state or lat and lng.</p>

- **Documentation:** [https://scrappa.co/docs/gasbuddy-api/gasbuddy_stations](https://scrappa.co/docs/gasbuddy-api/gasbuddy_stations)
- **API group:** GasBuddy API
- **Endpoint:** `GET https://scrappa.co/api/gasbuddy/stations`

## 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 |
| --- | --- | --- | --- |
| `search` | string | No | ZIP code or City, ST. Send search or both lat and lng |
| `lat` | number | No | Latitude, send with lng instead of search |
| `lng` | number | No | Longitude, send with lat instead of search |
| `fuel` | integer | No | Fuel id: 1 regular, 2 midgrade, 3 premium, 4 diesel, 5 E85, 12 UNL88 |
| `brand_id` | integer | No | Brand id from a GasBuddy search result |
| `maxAge` | integer | No | Maximum price age in hours, 0 means no limit |
| `cursor` | string | No | Pagination token from a previous stations cursor.next |

## Example response

```json
{
    "data": {
        "trends": [
            {
                "today": 3.19,
                "trend": "steady",
                "country": "US",
                "areaName": "Arizona",
                "todayLow": 3.05
            }
        ],
        "stations": {
            "count": 2,
            "cursor": {
                "next": "1"
            },
            "results": [
                {
                    "id": 205033,
                    "name": "Sunoco",
                    "brands": [
                        {
                            "name": "Shell",
                            "brandId": 122,
                            "imageUrl": "https://example.com/brand.png"
                        }
                    ],
                    "prices": [
                        {
                            "cash": {
                                "price": 4.15,
                                "postedTime": "2026-11-16T22:08:51.514Z"
                            },
                            "price": 4.15,
                            "fuelProduct": "regular",
                            "formattedPrice": "$4.15"
                        }
                    ],
                    "currency": "USD",
                    "priceUnit": "dollars_per_gallon",
                    "starRating": 4.2,
                    "ratingsCount": 87
                }
            ]
        },
        "countryCode": "US",
        "displayName": "85396"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "stations"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | Send search or both lat and lng, or use an unsupported fuel id. Failed requests are not billed. |
| 503 | Temporarily Unavailable | Fuel price data is temporarily unreachable. Failed requests are not billed. |

## 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)
