{
  "openapi": "3.0.1",
  "info": {
    "title": "Air Quality API, Pollen Count and Wildfire Risk by Ambee",
    "description": "Ambee API for hourly air quality (AQI, PM2.5, PM10, NO2, O3, CO, SO2), pollen count and risk by grass, tree, weed and species, weather, North America wildfire risk and live natural disaster events. Latest, history and forecast by coordinates, place, country or continent. Bring your own key.",
    "version": "0.1",
    "x-build-id": "QrpppmsKOJh9iCDZ0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~air-quality-pollen-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-air-quality-pollen-api",
        "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/nabeelbaghoor~air-quality-pollen-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-air-quality-pollen-api",
        "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/nabeelbaghoor~air-quality-pollen-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-air-quality-pollen-api",
        "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": {
          "mode": {
            "title": "What to get",
            "enum": [
              "airQuality",
              "pollen",
              "weather",
              "wildfireRisk",
              "disastersNearby",
              "disastersByCountry",
              "disastersByContinent",
              "disastersInPolygon",
              "disasterFootprint"
            ],
            "type": "string",
            "description": "Air quality: hourly AQI, PM2.5, PM10, NO2, ozone, CO and SO2. Pollen: hourly grass, tree and weed pollen counts and risk, with species detail. Weather: hourly temperature, humidity, wind, precipitation and more. These three take a timeframe (latest, history or forecast). Wildfire risk forecast: weekly risk for the next 4 weeks in North America. Natural disasters near coordinates, by country, by continent or in a polygon: events of the last month such as wildfires, floods, earthquakes and cyclones. Disaster event footprint: the polygon of one event.",
            "default": "airQuality"
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Air quality, pollen, weather, wildfire risk and disasters near coordinates. One location per line: lat,lng coordinates such as 12.9889055,77.574044, or a place name such as Bengaluru or Leon, Mexico. Disasters near coordinates take coordinates only.",
            "items": {
              "type": "string"
            }
          },
          "countryCodes": {
            "title": "Country codes",
            "type": "array",
            "description": "Natural disasters by country only. 3 letter ISO country codes, one per line, such as USA, GBR or IND.",
            "items": {
              "type": "string"
            }
          },
          "continents": {
            "title": "Continents",
            "type": "array",
            "description": "Natural disasters by continent only. One or more continents.",
            "items": {
              "type": "string",
              "enum": [
                "AFR",
                "ANT",
                "ASIA",
                "AUS",
                "EUR",
                "NAR",
                "SAR",
                "Ocean"
              ],
              "enumTitles": [
                "Africa",
                "Antarctica",
                "Asia",
                "Australia",
                "Europe",
                "North America",
                "South America",
                "Ocean"
              ]
            }
          },
          "polygon": {
            "title": "Polygon",
            "type": "array",
            "description": "Natural disasters in a polygon only. One lat,lng vertex per line, at least 3; the ring is closed for you. Ambee accepts areas of up to 100 km2.",
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "title": "Event IDs",
            "type": "array",
            "description": "Disaster event footprint only. One event_id per line, as returned in the eventId column of a disaster mode.",
            "items": {
              "type": "string"
            }
          },
          "timeframe": {
            "title": "Timeframe",
            "enum": [
              "latest",
              "history",
              "forecast"
            ],
            "type": "string",
            "description": "Air quality, pollen and weather only. Latest is the current hour; history reads every hour between the history start and end; forecast reads the next 48 hours (or 120 hours for pollen and weather).",
            "default": "latest"
          },
          "forecastHours": {
            "title": "Forecast length",
            "enum": [
              "48",
              "120"
            ],
            "type": "string",
            "description": "Pollen and weather forecasts only. Ambee forecasts air quality 48 hours ahead.",
            "default": "48"
          },
          "historyFrom": {
            "title": "History start",
            "type": "string",
            "description": "History timeframe only. YYYY-MM-DD or YYYY-MM-DD hh:mm:ss, read as UTC. Defaults to 24 hours before the end. The window is read in slices of 48 hours, up to 31 days."
          },
          "historyTo": {
            "title": "History end",
            "type": "string",
            "description": "History timeframe only. YYYY-MM-DD or YYYY-MM-DD hh:mm:ss, read as UTC. Defaults to the current hour."
          },
          "aqiStandard": {
            "title": "AQI standard",
            "enum": [
              "EPA",
              "IN",
              "UK",
              "CN",
              "CA"
            ],
            "type": "string",
            "description": "Air quality only. The standard Ambee uses to calculate the AQI value and its category.",
            "default": "EPA"
          },
          "speciesRisk": {
            "title": "Species level pollen risk",
            "type": "boolean",
            "description": "Pollen only. Asks Ambee for sub species risk where the region supports it.",
            "default": false
          },
          "units": {
            "title": "Weather units",
            "enum": [
              "imperial",
              "si"
            ],
            "type": "string",
            "description": "Weather only. SI sends units=si to Ambee.",
            "default": "imperial"
          },
          "includeLocalTime": {
            "title": "Add local time",
            "type": "boolean",
            "description": "Air quality, pollen and weather only. Asks Ambee to add the localTime of each reading.",
            "default": false
          },
          "eventType": {
            "title": "Disaster event type",
            "enum": [
              "WF",
              "FL",
              "EQ",
              "TC",
              "SW",
              "ET",
              "DR",
              "VO",
              "LS",
              "TN",
              "SI",
              "Misc"
            ],
            "type": "string",
            "description": "Natural disasters near coordinates, by country or by continent, optional. Keeps only events of this type."
          },
          "language": {
            "title": "Response language",
            "enum": [
              "EN",
              "DE",
              "ES",
              "FR",
              "IT",
              "NL",
              "JA",
              "CN"
            ],
            "type": "string",
            "description": "Optional. Sent as the Accept-Language header; Ambee enables languages other than English on demand."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Pacing for calls to the Ambee API. Your Ambee plan sets the real ceiling.",
            "default": 60
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own Ambee API key from api-dashboard.getambee.com. Stored as a secret and sent only to api.ambeedata.com in the x-api-key header; it is never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}