{
  "openapi": "3.0.1",
  "info": {
    "title": "EPA Air Quality & AQI Lookup",
    "description": "Download official AirNow daily files and export normalized EPA air-quality observations and AQI values by date, place, site, pollutant, country, or U.S. state.",
    "version": "0.1",
    "x-build-id": "CPbGULE2H6CfLDvOE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~epa-air-quality-aqi-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-epa-air-quality-aqi-lookup",
        "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/automation-lab~epa-air-quality-aqi-lookup/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-epa-air-quality-aqi-lookup",
        "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/automation-lab~epa-air-quality-aqi-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-epa-air-quality-aqi-lookup",
        "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": {
          "daysAgo": {
            "title": "Days before today's UTC date",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Optional integer 0–30, resolved once at run start: 0=today, 1=yesterday. For recurring schedules use 1. Cannot be combined with nonempty dates or either range endpoint. Recent files remain preliminary, not guaranteed complete. Omit all date options to preserve today's UTC date."
          },
          "dates": {
            "title": "Observation dates",
            "maxItems": 31,
            "type": "array",
            "description": "Specific dates in YYYY-MM-DD format (maximum 31), processed in supplied order with duplicate dates removed. Cannot combine with daysAgo or a range.",
            "items": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          "startDate": {
            "title": "Range start date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "First date in an inclusive range, in YYYY-MM-DD format. Use with endDate instead of dates."
          },
          "endDate": {
            "title": "Range end date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Last date in an inclusive range of at most 31 days, in YYYY-MM-DD format."
          },
          "places": {
            "title": "Place filters",
            "type": "array",
            "description": "Case-insensitive text matched against site name, reporting agency, and site identifiers, for example Sacramento or California.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "siteIds": {
            "title": "Monitoring site IDs",
            "type": "array",
            "description": "Exact AirNow nine-character site IDs or full AQS IDs.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "pollutants": {
            "title": "Pollutants or parameters",
            "type": "array",
            "description": "Pollutant names such as PM2.5, OZONE, PM10, CO, NO2, or SO2; full parameters such as OZONE-8HR are also accepted.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "countryCodes": {
            "title": "Country codes",
            "type": "array",
            "description": "Three-digit country prefixes from the full AQS identifier, for example 840 for the United States or 124 for Canada.",
            "items": {
              "type": "string",
              "pattern": "^\\d{3}$"
            }
          },
          "stateFips": {
            "title": "U.S. state FIPS codes",
            "type": "array",
            "description": "Two-digit state FIPS codes for U.S. monitoring sites, for example 06 for California or 36 for New York.",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}$"
            }
          },
          "onlyWithAqi": {
            "title": "Only records with AQI",
            "type": "boolean",
            "description": "When enabled, omit valid concentration records for which AirNow does not calculate an 8-hour or 24-hour AQI.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Global maximum matching observations saved across all requested dates, in date/source order, after filters. Default 1000; 1–50000, no unlimited value. Later dates are not attempted once reached; billing limits can stop output sooner. Inspect RUN_SUMMARY for coverage.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}