ScrapeNest Gas prices API

Live US gas station prices.

GitHub OpenAPI

Operations 1

POST /v1/scrape/gas-prices Get live US gas prices for a location #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/scrapenest-dev:scrapenest-dev-gas-prices-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

scrapenest-dev-gas-prices-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: ScrapeNest Gas prices API
  description: 'AI search + scraping as an API for developers and AI agents. Send your API key as `Authorization: Bearer sn_...` on every call. Errors are JSON envelopes. The API never answers 502 or 504: an upstream or capacity failure is a 503 with Retry-After.'
  version: 1.0.0
  termsOfService: https://scrapenest.dev/terms
  contact:
    name: ScrapeNest support
    url: https://scrapenest.dev/support
    email: support@scrapenest.dev
servers:
- url: https://scrapenest.dev
security:
- bearerAuth: []
tags:
- name: Gas prices
  description: Live US gas station prices.
paths:
  /v1/scrape/gas-prices:
    post:
      tags:
      - Gas prices
      summary: Get live US gas prices for a location
      operationId: gasPrices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GasPricesRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GasPricesResponse'
        '422':
          description: Error response in ScrapeNest's standard envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        4XX:
          description: Error response in ScrapeNest's standard envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        5XX:
          description: Error response in ScrapeNest's standard envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      description: Live US gas prices by ZIP or City, ST. Parsed JSON, all fuel grades. 10 credits flat.
      externalDocs:
        description: Guide and examples
        url: https://scrapenest.dev/docs#ep-gas-prices
components:
  schemas:
    GasPricesRequest:
      properties:
        location:
          type: string
          maxLength: 200
          minLength: 2
          title: Location
          description: Search anchor, any case. Accepts a US ZIP (`63011`, `63011-1234`), `City, ST` with or without the comma (`Ballwin, MO`, `ballwin mo`), `City, State` (`Saint Louis, Missouri`), a bare city (`Austin`), or `lat,lng` coordinates (`38.5917,-90.5502`). A location that cannot be resolved to a US place returns `422 validation_error` naming `location`. Ambiguous strings resolve to the best match; check `location.city` and `location.state`.
        grade:
          type: string
          enum:
          - regular
          - midgrade
          - premium
          - diesel
          - e85
          title: Grade
          description: 'Fuel grade: regular, midgrade, premium, diesel, or e85 (case-insensitive).'
          default: regular
        limit:
          type: integer
          maximum: 50.0
          minimum: 1.0
          title: Limit
          description: Hard cap on returned stations (listings typically surface ~13 by default).
          default: 20
        cache_ttl_seconds:
          anyOf:
          - type: integer
            maximum: 3600.0
            minimum: 0.0
          - type: 'null'
          title: Cache Ttl Seconds
          description: Override the cache TTL (max 1 hour, prices change slowly).
        include_usage:
          type: boolean
          title: Include Usage
          description: If true, include a `usage` block in the response with credit totals.
          default: false
      type: object
      required:
      - location
      title: GasPricesRequest
    RegionStats:
      properties:
        state:
          anyOf:
          - type: string
          - type: 'null'
          title: State
          description: USPS two-letter state code when the heading is a US state (e.g. 'IL'). Null when the heading is a city; see `region` for the verbatim heading.
        region:
          anyOf:
          - type: string
          - type: 'null'
          title: Region
          description: Verbatim heading text from the source listing. For state-level stats this is the full state name (e.g. 'Illinois'); for city-level stats this is the city (e.g. 'Chicago').
        region_type:
          anyOf:
          - type: string
            enum:
            - state
            - city
          - type: 'null'
          title: Region Type
          description: Whether `region` names a state or a city.
        lowest_price:
          anyOf:
          - type: number
          - type: 'null'
          title: Lowest Price
        average_price:
          anyOf:
          - type: number
          - type: 'null'
          title: Average Price
      type: object
      title: RegionStats
    ErrorDetail:
      properties:
        type:
          anyOf:
          - type: string
          - type: 'null'
          title: Type
          description: Machine-readable error type for this item.
        loc:
          anyOf:
          - items: {}
            type: array
          - type: 'null'
          title: Loc
          description: Path to the offending field, e.g. ["body", "query"].
        msg:
          type: string
          title: Msg
          description: Human-readable description of this error item.
      additionalProperties: true
      type: object
      required:
      - msg
      title: ErrorDetail
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
      - error
      title: ErrorEnvelope
    GasStation:
      properties:
        brand:
          anyOf:
          - type: string
          - type: 'null'
          title: Brand
        sub_brand:
          anyOf:
          - type: string
          - type: 'null'
          title: Sub Brand
        station_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Station Id
        address:
          anyOf:
          - type: string
          - type: 'null'
          title: Address
        city:
          anyOf:
          - type: string
          - type: 'null'
          title: City
        state:
          anyOf:
          - type: string
          - type: 'null'
          title: State
        price:
          anyOf:
          - type: number
          - type: 'null'
          title: Price
        currency:
          type: string
          title: Currency
          default: USD
        unit:
          type: string
          title: Unit
          default: USD/gallon
        reporter:
          anyOf:
          - type: string
          - type: 'null'
          title: Reporter
        updated_relative:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated Relative
      type: object
      title: GasStation
    ErrorBody:
      properties:
        code:
          type: string
          title: Code
          description: Stable machine-readable error code, e.g. "validation_error".
        message:
          type: string
          title: Message
          description: Human-readable summary of the error.
        details:
          anyOf:
          - items:
              $ref: '#/components/schemas/ErrorDetail'
            type: array
          - type: 'null'
          title: Details
          description: Present on validation errors; one entry per offending field.
        retryable:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Retryable
          description: 'Present on some errors: true when the same request may succeed if retried.'
        retry_after:
          anyOf:
          - type: integer
          - type: 'null'
          title: Retry After
          description: 'Present on rate limits and some throttles: seconds to wait before retrying, the same value as the Retry-After header.'
      additionalProperties: true
      type: object
      required:
      - code
      - message
      title: ErrorBody
    UsageBlock:
      properties:
        credits:
          type: integer
          title: Credits
          description: Total credits charged for this call.
        breakdown:
          anyOf:
          - additionalProperties:
              type: integer
            type: object
          - type: 'null'
          title: Breakdown
          description: 'Optional per-component breakdown (e.g. {''search'': 1, ''ai_extract'': 5}).'
      type: object
      required:
      - credits
      title: UsageBlock
    GasPricesResponse:
      properties:
        location:
          $ref: '#/components/schemas/ResolvedLocation'
        grade:
          type: string
          enum:
          - regular
          - midgrade
          - premium
          - diesel
          - e85
          title: Grade
        stations:
          items:
            $ref: '#/components/schemas/GasStation'
          type: array
          title: Stations
        region_stats:
          anyOf:
          - $ref: '#/components/schemas/RegionStats'
          - type: 'null'
        source_url:
          type: string
          title: Source Url
        fetched_at:
          type: string
          title: Fetched At
        took_ms:
          type: integer
          title: Took Ms
          default: 0
        cache_hit:
          type: boolean
          title: Cache Hit
          default: false
        credits_charged:
          type: integer
          title: Credits Charged
          default: 0
        usage:
          anyOf:
          - $ref: '#/components/schemas/UsageBlock'
          - type: 'null'
        note:
          anyOf:
          - type: string
          - type: 'null'
          title: Note
          description: Set when the listing returned stations but no per-station prices, when an ambiguous location was auto-resolved to an unexpected region, or when other caveats apply that the caller should surface.
      type: object
      required:
      - location
      - grade
      - stations
      - source_url
      - fetched_at
      title: GasPricesResponse
    ResolvedLocation:
      properties:
        query:
          type: string
          title: Query
        zip:
          anyOf:
          - type: string
          - type: 'null'
          title: Zip
        city:
          anyOf:
          - type: string
          - type: 'null'
          title: City
        state:
          anyOf:
          - type: string
          - type: 'null'
          title: State
      type: object
      required:
      - query
      title: ResolvedLocation
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your ScrapeNest API key, sent as Authorization: Bearer sn_... on every call. Create keys in the dashboard; a key works once the account''s email is verified.'
externalDocs:
  description: Guides, credit costs and error codes
  url: https://scrapenest.dev/docs