# Get Forecast

{% hint style="info" %}
Please note that `phq_features` can only be retrieved if you have also purchased the Features product.
{% endhint %}

## GET /v1/forecasts/models/{model\_id}/forecast

> Get Forecast

```json
{"openapi":"3.1.0","info":{"title":"PredictHQ Forecasts API (Public Preview)","version":"1.0.0"},"tags":[{"name":"Forecasts"}],"servers":[{"url":"https://api.predicthq.com"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"$API_KEY","description":"Enter your PredictHQ API key. The Bearer prefix is added automatically.\n\nWhen calling the API directly, send: `Authorization: Bearer <YOUR_API_KEY>` as documented at [https://docs.predicthq.com/api/overview/authenticating](https://docs.predicthq.com/api/overview/authenticating)\n"}},"parameters":{"LimitParam":{"name":"limit","in":"query","description":"Limit the number of results.","required":false,"schema":{"type":"integer","default":10}},"OffsetParam":{"name":"offset","in":"query","description":"Offset the results.","required":false,"schema":{"type":"integer","default":0}}},"schemas":{"SearchModelForecastResponse":{"properties":{"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]},"count":{"type":"integer","title":"Count"},"next":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next"},"previous":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous"},"results":{"items":{"$ref":"#/components/schemas/PublicForecast"},"type":"array","title":"Results"}},"type":"object","required":["count"],"title":"SearchModelForecastResponse"},"PublicForecast":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"forecast":{"type":"number","title":"Forecast"},"phq_explainability":{"$ref":"#/components/schemas/PhqExplainability"},"phq_features":{"description":"List of the features (from our Features API) that were shown to have an impact on the demand. These features were used in training the model and for forecasting.","items":{"$ref":"#/components/schemas/Feature"},"type":"array","minItems":1,"title":"Phq Features"}},"type":"object","required":["date","forecast"],"title":"PublicForecast"},"PhqExplainability":{"description":"List of the top events impacting demand on each date. Use this to help understand the context of how and why events are impacting your demand.","properties":{"events":{"items":{"$ref":"#/components/schemas/Event"},"type":"array","minItems":0}},"type":"object"},"Event":{"properties":{"id":{"type":"string","minLength":1,"title":"Id"},"title":{"type":"string","minLength":1,"title":"Title"},"category":{"type":"string","minLength":1,"title":"Title"},"start_local":{"type":"string","format":"date-time","title":"Start"},"end_local":{"type":"string","format":"date-time","title":"End"},"phq_rank":{"type":"integer","maximum":100,"minimum":0,"title":"PHQ Rank"},"local_rank":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"title":"Local Rank"}},"type":"object","required":["id","title","category","start","end"],"title":"Event"},"Feature":{"properties":{"name":{"type":"string","minLength":1,"title":"Name"},"value":{"type":"number","title":"Value"}},"type":"object","required":["name","value"],"title":"Feature"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/forecasts/models/{model_id}/forecast":{"get":{"tags":["Forecasts"],"summary":"Get Forecast","operationId":"get_forecasts_models__model_id__forecast_get","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}},{"name":"date.gt","in":"query","description":"Filters forecast results after the specified date (exclusive).\n\nExpected format: `YYYY-MM-DD`","required":false,"schema":{"type":"string","format":"date"}},{"name":"date.gte","in":"query","description":"Filters forecast results on or after the specified date.\n\nExpected format: `YYYY-MM-DD`.\n\nExample: `2025-01-01`","required":false,"schema":{"type":"string","format":"date"}},{"name":"date.lt","in":"query","description":"Filters forecast results before the specified date (exclusive).\n\nExpected format: `YYYY-MM-DD`.","required":false,"schema":{"type":"string","format":"date"}},{"name":"date.lte","in":"query","description":"Filters forecast results on or before the specified date.\n\nExpected format: `YYYY-MM-DD`.\n\nExample: `2025-01-07`","required":false,"schema":{"type":"string","format":"date"}},{"name":"include","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["phq_features","phq_explainability"]},"title":"Include"},"description":"A comma-separated list of fields to be included in the response. By default `phq_features` and `phq_explainability` are not included."},{"$ref":"#/components/parameters/LimitParam"},{"$ref":"#/components/parameters/OffsetParam"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchModelForecastResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## OpenAPI Spec

The OpenAPI spec for Forecasts API can be [found here](https://api.predicthq.com/docs/?urls.primaryName=Forecasts+API).

## Guides

* [Getting Started with Forecasts API](https://docs.predicthq.com/getting-started/guides/forecasts-api-guides/getting-started)
* [Understanding Forecast Accuracy Metrics](https://docs.predicthq.com/getting-started/guides/forecasts-api-guides/understanding-forecast-accuracy-metrics)
* [Troubleshooting Guide for Forecasts API](https://docs.predicthq.com/getting-started/guides/forecasts-api-guides/troubleshooting)
