{
  "openapi": "3.0.1",
  "info": {
    "title": "Historical Weather API: Hourly, Daily, Forecast and Climatology",
    "description": "Historical weather API: daily and hourly weather history, 15 day forecast and climatology normals by latitude/longitude, ZIP or postal code, DMA or OnPoint ID. Temperature, precipitation, snowfall, humidity, wind, cloud cover and solar radiation from Weather Source OnPoint. Bring your own key.",
    "version": "0.1",
    "x-build-id": "V3OrjKQz8wht7rhfX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~historical-weather-climatology-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-historical-weather-climatology-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~historical-weather-climatology-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-historical-weather-climatology-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~historical-weather-climatology-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-historical-weather-climatology-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": "Data",
            "enum": [
              "history",
              "forecast",
              "climatology"
            ],
            "type": "string",
            "description": "Weather history (past days or hours, from the History API), the forecast (up to 15 days or 240 hours ahead, from the Forecast API) or climatology (typical weather for each calendar day or hour, from the Climatology API). Each calls the documented Weather Source OnPoint routes with your own key.",
            "default": "history"
          },
          "interval": {
            "title": "Interval",
            "enum": [
              "daily",
              "hourly"
            ],
            "type": "string",
            "description": "One row per day (min, average and max values and daily totals) or one row per hour.",
            "default": "daily"
          },
          "apiKey": {
            "title": "Weather Source API key",
            "type": "string",
            "description": "Your own Weather Source API key from your account at developer.weathersourceapis.com. Sent only in the X-API-KEY header to the Weather Source hosts and removed from every log line. Leave empty to use the DATA_API_KEY secret."
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "One location per line: a latitude,longitude pair (40.7128,-74.0060), a ZIP or postal code (10001, or M5V 3L9,CA with a country code), a Designated Market Area as dma:501, or an OnPoint grid point as onpoint:10725864. Duplicates are read once, and lines that are not a location are skipped for free.",
            "items": {
              "type": "string"
            }
          },
          "countryCode": {
            "title": "Default country for postcodes",
            "type": "string",
            "description": "Two-letter ISO country code used for postcodes written without one, such as US, CA or GB.",
            "default": "US"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "History and climatology only, and then required. YYYY-MM-DD. For hourly data you may also give a date-time such as 2024-07-01T06:00:00-04:00 (no offset means UTC); a bare date starts at 00:00 UTC."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "History and climatology only. YYYY-MM-DD, or a date-time for hourly data; a bare date ends at 23:00 UTC. Leave empty for the start date alone. Periods longer than the documented 1 year per request are split automatically."
          },
          "fields": {
            "title": "Weather fields",
            "type": "array",
            "description": "Field names or documented groups. Groups: popular (cloud cover, feels like, precipitation, humidity, snowfall, temperature, wind), all, allTemp, allPrecip, allHum, allWind, allPres, allRad, allCldCvr. Daily names carry Min, Avg or Max (tempMax, relHumAvg, windSpdMax, precip, snowfall); hourly names are plain (temp, relHum, windSpd). Climatology adds Sd, percentile and frequency fields such as tempAvgSd, precip90p and precipFreq. Leave empty for popular. Fewer fields make answers faster.",
            "items": {
              "type": "string"
            }
          },
          "unitScale": {
            "title": "Units",
            "enum": [
              "IMPERIAL",
              "METRIC",
              "SI"
            ],
            "type": "string",
            "description": "IMPERIAL (Fahrenheit, inches, miles per hour), METRIC (Celsius, centimeters, km per hour) or SI (Kelvin, centimeters, km per hour). The units of every returned field are saved to the key-value store as FIELD_UNITS.",
            "default": "METRIC"
          },
          "maxResults": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "The run stops after this many rows (one row per location and day or hour). It also caps how many locations are read.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}