Skip to main content

ForecastService

A list of all methods in the ForecastService service. Click on the method name to view detailed information about that method.

MethodsDescription
forecast_dataThe weatherstack is capable of returning weather forecast data for up to 14 days into the future. To get weather forecasts, simply use the API's forecast endpoint and define your preferred number of forecast days using the forecast_days parameter.

forecast_data

The weatherstack is capable of returning weather forecast data for up to 14 days into the future. To get weather forecasts, simply use the API's forecast endpoint and define your preferred number of forecast days using the forecast_days parameter.

  • HTTP Method: GET
  • Endpoint: /forecast

Parameters

NameTypeRequiredDescription
access_keystr[Required] Use this parameter to pass your unique API access key to the API.
querystr[Required] Use this parameter to pass a single location or multiple semicolon-separated location identifiers to the API. Learn more about the Query Parameter.
forecast_daysstr[Optional] Use this parameter to specify the number of days for which the API returns forecast data. (Default: 7 or 14 days, depending on your subscription)

Return Type

ForecastDataOkResponse

Example Usage Code Snippet

from weatherstack import Weatherstack, Environment

sdk = Weatherstack(
base_url=Environment.DEFAULT.value
)

result = sdk.forecast.forecast_data(
access_key="YOUR_ACCESS_KEY",
query="New York",
forecast_days="7"
)

print(result)

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →