{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Gas Prices by Station: Gasoline, Diesel (CNE, daily)",
    "description": "Daily retail gasoline (regular, premium) and diesel prices for every gas station in Mexico reported to the CNE, in MXN, USD and EUR, with station location, state and municipality. Daily archive since 2026-10-25, updated weekly. API and AI-agent (MCP) ready.",
    "version": "0.1",
    "x-build-id": "8OgWxnH5RdqOflbtH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pracadata~mexico-fuel-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pracadata-mexico-fuel-prices",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/pracadata~mexico-fuel-prices/runs": {
      "post": {
        "operationId": "runs-sync-pracadata-mexico-fuel-prices",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/pracadata~mexico-fuel-prices/run-sync": {
      "post": {
        "operationId": "run-sync-pracadata-mexico-fuel-prices",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "state": {
            "title": "State",
            "type": "array",
            "description": "One or more Mexican states by official INEGI name (case and accents are ignored: `Nuevo Leon` = `Nuevo León`), by abbreviation (`CDMX`, `NL`, `BC`, `Jal.`), by common short name (`Coahuila`, `Veracruz`, `Michoacán`, `Edomex`) or by 2-digit code (`09` = Ciudad de México, `14` = Jalisco). Optional. Combined with `municipality`, it narrows it (useful for names that repeat across states, such as Benito Juárez). A state that does not exist is refused. Note that `México` is the state surrounding the capital.",
            "items": {
              "type": "string"
            }
          },
          "municipality": {
            "title": "Municipality",
            "type": "array",
            "description": "One or more municipalities, by official INEGI name (case, accents and punctuation are ignored: `Merida`, `mérida` and `MÉRIDA` are the same) or by 5-digit municipality code (`09014` = Benito Juárez, Ciudad de México; `14039` = Guadalajara). Several municipalities share a name (there are 7 `Benito Juárez`): add `state`, or the run covers all of them (`RUN_SUMMARY.matched_municipalities` says how many). A name that does not exist is refused. Up to 200 values.",
            "items": {
              "type": "string"
            }
          },
          "product": {
            "title": "Product",
            "type": "array",
            "description": "One or more of `gasoline` (regular grade), `gasoline_premium` (premium) and `diesel`. All in MXN per litre. No value means every product.",
            "items": {
              "type": "string",
              "enum": [
                "gasoline",
                "gasoline_premium",
                "diesel"
              ],
              "enumTitles": [
                "Gasoline (regular)",
                "Premium gasoline",
                "Diesel"
              ]
            }
          },
          "date_from": {
            "title": "Date from",
            "type": "string",
            "description": "First day, format YYYY-MM-DD. Optional; the default is 6 days before `date_to` (7 days in total). The day is the CNE `reference_date`: the official feed turns over at 18:00 Mexico time, so a day starts the evening before (see README). The archive starts on 2026-10-25."
          },
          "date_to": {
            "title": "Date to",
            "type": "string",
            "description": "Last day, format YYYY-MM-DD, inclusive. Optional; the default is the latest day in the data (see `data_until` in the run summary)."
          },
          "station_id": {
            "title": "Station id",
            "type": "array",
            "description": "One or more station ids exactly as in the `station_id` column (the CNE permit id of the station, for example `CNE/PL/138/EXP/ES/2025`; case is ignored). Optional, up to 500. Use it to follow the same stations over time.",
            "items": {
              "type": "string"
            }
          },
          "max_rows": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of rows returned (1 to 1,000,000; default 10,000). Rows are charged one by one, so this is also the cost cap: 10,000 rows is US$ 20. Set a small value (for example 10) to test a query. If the filter matches more rows, the rest is not returned: `RUN_SUMMARY.capped_by_max_rows` is true. The whole country for one day is about 37,000 rows.",
            "default": 10000
          },
          "currency": {
            "title": "Currency of the `price` column",
            "enum": [
              "MXN",
              "USD",
              "EUR"
            ],
            "type": "string",
            "description": "Which currency fills the `price` column (`price_currency` says which). `price_mxn`, `price_usd` and `price_eur` are always present. USD and EUR use the ECB reference rate of the previous business day, or the latest one in the 7 days before it (USD/MXN is a derived cross rate), and are null when no rate exists; MXN is the price as reported to the CNE. Default: USD.",
            "default": "USD"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}