{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Fuel Prices by City (ANP Combustíveis)",
    "description": "Weekly fuel prices in Brazil from the ANP open data survey (not affiliated with the ANP): average, minimum, maximum, standard deviation and stations surveyed per municipality, with IBGE code and week-over-week changes. Optional price per gas station (company, CNPJ, brand, address).",
    "version": "0.1",
    "x-build-id": "q2jFiqvi8vNlS25RB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/br_data_hub~br-anp-fuel-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-br_data_hub-br-anp-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/br_data_hub~br-anp-fuel-prices/runs": {
      "post": {
        "operationId": "runs-sync-br_data_hub-br-anp-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/br_data_hub~br-anp-fuel-prices/run-sync": {
      "post": {
        "operationId": "run-sync-br_data_hub-br-anp-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": {
          "municipalities": {
            "title": "Municipalities",
            "type": "array",
            "description": "Enter municipalities as name/state (\"São Paulo/SP\") or 7-digit IBGE code (\"3550308\"), one per line. A row is returned if it matches a municipality or a state below. Leave both empty for all of Brazil (municipal output only).",
            "default": [
              "São Paulo/SP",
              "Rio de Janeiro/RJ",
              "Belo Horizonte/MG"
            ],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Enter two-letter state codes, e.g. SP or MG, one per line. Every surveyed municipality of these states is returned.",
            "items": {
              "type": "string"
            }
          },
          "fuels": {
            "title": "Fuels",
            "type": "array",
            "description": "Pick the fuels to return. Leave empty for all. Diesel S500 is ANP's plain \"diesel\" (comum); LPG is the 13 kg cylinder.",
            "items": {
              "type": "string",
              "enum": [
                "gasoline",
                "gasoline_premium",
                "ethanol",
                "diesel_s10",
                "diesel_s500",
                "cng",
                "lpg"
              ],
              "enumTitles": [
                "Gasoline (comum)",
                "Gasoline (aditivada)",
                "Ethanol (hidratado)",
                "Diesel S10",
                "Diesel S500",
                "CNG (GNV)",
                "LPG 13 kg (GLP)"
              ]
            }
          },
          "mode": {
            "title": "Output type",
            "enum": [
              "municipal",
              "stations"
            ],
            "type": "string",
            "description": "Choose \"Weekly prices by municipality\" for one row per municipality, fuel and week (average, min, max, standard deviation, stations surveyed), or \"Price per gas station\" for one row per station, fuel and week, with company, CNPJ, brand, address and resale price.",
            "default": "municipal"
          },
          "weeks": {
            "title": "Latest weeks",
            "minimum": 1,
            "maximum": 260,
            "type": "integer",
            "description": "Set how many of the most recent survey weeks to return (ANP weeks run Sunday to Saturday), e.g. 4 for the last month. Ignored when you fill in a date below.",
            "default": 4
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Pick the start of the period (YYYY-MM-DD) to use instead of Latest weeks. Weeks that overlap the period are returned."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Pick the end of the period (YYYY-MM-DD). Leave empty for today."
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 0,
            "type": "integer",
            "description": "Set the maximum number of rows to save (each row is one charged price event), e.g. 1000 to cap the cost. 0 means no limit.",
            "default": 0
          },
          "sourceUrls": {
            "title": "ANP file URLs",
            "type": "array",
            "description": "Paste direct links to ANP spreadsheets (.xlsx, municipal output) or station CSV/ZIP files (station output) only if ANP renamed its files and discovery fails. Leave empty normally.",
            "items": {
              "type": "string"
            }
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave off normally. Turn on Apify Proxy with country BR only if gov.br stops answering from the Apify cloud (it may block traffic from outside Brazil).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}