{
  "openapi": "3.0.1",
  "info": {
    "title": "Precios de gasolineras: España, México y Argentina",
    "description": "Precios oficiales de gasolina, diésel, GLP y GNC por gasolinera en España, México y Argentina, con marca, dirección y coordenadas. Filtre por provincia, producto o radio en kilómetros. El modo monitor entrega solo las estaciones cuyo precio cambió. Fuentes: MITECO, CNE y Secretaría de Energía.",
    "version": "1.3",
    "x-build-id": "ctnXh6AFvvQGQhOkD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/opendata-cr~fuel-prices-es-mx-ar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-opendata-cr-fuel-prices-es-mx-ar",
        "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/opendata-cr~fuel-prices-es-mx-ar/runs": {
      "post": {
        "operationId": "runs-sync-opendata-cr-fuel-prices-es-mx-ar",
        "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/opendata-cr~fuel-prices-es-mx-ar/run-sync": {
      "post": {
        "operationId": "run-sync-opendata-cr-fuel-prices-es-mx-ar",
        "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": {
          "countries": {
            "title": "Países",
            "type": "array",
            "description": "Países a descargar. ES es España, MX es México, AR es Argentina. Un país que no esté aquí no se pide.",
            "items": {
              "type": "string",
              "enum": [
                "ES",
                "MX",
                "AR"
              ],
              "enumTitles": [
                "España",
                "México",
                "Argentina"
              ]
            },
            "default": [
              "ES",
              "MX",
              "AR"
            ]
          },
          "states": {
            "title": "Provincia o estado",
            "type": "array",
            "description": "Filtro por provincia o estado, sin tildes y sin distinguir mayúsculas. En México el estado sale de las coordenadas. Si todos los nombres son provincias de España, la descarga de España usa el archivo de cada provincia.",
            "items": {
              "type": "string"
            }
          },
          "products": {
            "title": "Productos",
            "type": "array",
            "description": "Códigos de producto. Vacío devuelve todos los de la estación. También valen alias: gnc, glp, gasoleo, premium, regular.",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "gasoline_regular",
                "gasoline_premium",
                "diesel",
                "diesel_premium",
                "lpg",
                "cng",
                "lng",
                "gasoline_regular_premium",
                "diesel_agricultural",
                "adblue"
              ]
            }
          },
          "latitude": {
            "title": "Latitud",
            "type": "number",
            "description": "Centro del radio, en grados. Hace falta también la longitud y el radio."
          },
          "longitude": {
            "title": "Longitud",
            "type": "number",
            "description": "Centro del radio, en grados. Negativa al oeste de Greenwich."
          },
          "radiusKm": {
            "title": "Radio (km)",
            "minimum": 0,
            "maximum": 20000,
            "type": "number",
            "description": "Radio en kilómetros, inclusive. Las estaciones sin coordenadas quedan fuera."
          },
          "maxItems": {
            "title": "Máximo de estaciones",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Tope de estaciones escritas. El formulario propone 25. Si se omite el campo, el tope es 100. Si hay varios países y el tope no alcanza para todos, las estaciones se reparten para que aparezca cada país. Si se alcanza el máximo a cobrar de la ejecución, esta termina con éxito.",
            "default": 100
          },
          "maxPriceAgeDays": {
            "title": "Antigüedad máxima del precio (días)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Quita precios cuya fecha en la fuente supera este número de días. El valor por defecto es 90. México no publica fecha, así que no entra en este corte. Si en la entrada JSON se envía null, no hay límite.",
            "default": 90
          },
          "onlyNewSinceLastRun": {
            "title": "Solo cambios desde la última ejecución",
            "type": "boolean",
            "description": "Guarda los precios de cada estación. En la siguiente ejecución solo escribe las estaciones cuyo precio cambió. Una estación que no estaba guardada se cobra como bloque normal (station-batch, US$0.04 por bloque de hasta 50). Solo un cambio de una estación ya vista se cobra como price-change (US$0.0015). Solo se comparan los precios, no la hora del archivo.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Nombre del almacén del monitor",
            "type": "string",
            "description": "Almacén (Key-Value Store) donde se guardan los precios ya vistos. Use un nombre distinto para cada alerta.",
            "default": "fuel-prices-monitor"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Solo para España. Si la fuente rechaza la conexión, el Actor hace varios intentos, alternando la conexión directa y el proxy de Apify. Si activa el proxy o escribe URLs, se usa esa configuración. Si España no responde, se omite y los otros países siguen.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}