# Get Model

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

> Get Model

```json
{"openapi":"3.1.0","info":{"title":"PredictHQ Forecasts API (Public Preview)","version":"1.0.0"},"tags":[{"name":"Models"}],"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"}},"schemas":{"GetModelResponse":{"properties":{"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]},"model":{"$ref":"#/components/schemas/PublicForecastModel"}},"type":"object","required":["model"],"title":"GetModelResponse"},"PublicForecastModel":{"properties":{"algo":{"$ref":"#/components/schemas/AlgoType"},"create_dt":{"type":"string","format":"date-time","title":"Create Dt"},"demand_type":{"anyOf":[{"$ref":"#/components/schemas/PublicDemandType"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"External Id"},"forecast_window":{"$ref":"#/components/schemas/ForecastWindowDay"},"label":{"anyOf":[{"items":{"type":"string","minLength":1},"type":"array","minItems":1},{"type":"null"}],"title":"Label"},"location":{"$ref":"#/components/schemas/Location"},"metrics":{"anyOf":[{"$ref":"#/components/schemas/PublicMetrics"},{"type":"null"}]},"model_id":{"type":"string","minLength":1,"title":"Model Id"},"name":{"type":"string","minLength":1,"title":"Name"},"readiness":{"$ref":"#/components/schemas/Readiness"},"train_dt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Train Dt"},"update_dt":{"type":"string","format":"date-time","title":"Update Dt"}},"type":"object","required":["algo","create_dt","forecast_window","location","model_id","name","readiness","update_dt"],"title":"PublicForecastModel"},"AlgoType":{"type":"string","enum":["phq-xgboost"]},"PublicDemandType":{"properties":{"interval":{"anyOf":[{"$ref":"#/components/schemas/PublicInterval"},{"type":"null"}]},"industry":{"anyOf":[{"$ref":"#/components/schemas/Industry"},{"type":"null"}]}},"type":"object","title":"PublicDemandType"},"PublicInterval":{"type":"string","enum":["day"],"title":"PublicInterval"},"Industry":{"description":"Choosing the right industry is important as this will determine the type of features used in the training and forecasting and will impact the accuracy of the results. We will use the applicable Predicted Impact Patterns for the specified industry.","type":"string","enum":["accommodation","cpg","tourism","marketing","parking","restaurants","retail","transportation","other"],"title":"Industry"},"ForecastWindowDay":{"type":"string","enum":["1d","7d","14d","28d","30d","60d","90d"],"title":"ForecastWindowDay"},"Location":{"properties":{"saved_location_id":{"type":"string","minLength":1,"title":"Saved Location ID"}},"type":"object","required":["saved_location_id"],"title":"Location"},"PublicMetrics":{"properties":{"accuracy":{"anyOf":[{"$ref":"#/components/schemas/Accuracy"},{"type":"null"}]},"demand_data":{"$ref":"#/components/schemas/DemandDataMetrics"},"training_data":{"anyOf":[{"$ref":"#/components/schemas/TrainingDataMetrics"},{"type":"null"}]}},"type":"object","required":["demand_data"],"title":"PublicMetrics"},"Accuracy":{"description":"Forecast accuracy metrics calculated by comparing predicted values against actual historical values. These metrics help assess how well the model is performing.","properties":{"mape":{"type":"number","description":"Mean Absolute Percentage Error (MAPE). Represents the average absolute percentage difference between forecasted and actual values. Lower values indicate more accurate predictions."},"mae":{"type":"number","description":"Mean Absolute Error (MAE). The average of the absolute differences between forecasted and actual values. Useful for understanding the average magnitude of errors in the forecast."},"rmse":{"type":"number","description":"Root Mean Squared Error (RMSE). Measures the square root of the average squared differences between forecasted and actual values. It penalizes larger errors more heavily than MAE."}},"type":"object","required":["mape","mae","rmse"]},"DemandDataMetrics":{"properties":{"date_range":{"$ref":"#/components/schemas/DateRange"}},"type":"object","required":["date_range"],"title":"DemandDataMetrics"},"DateRange":{"properties":{"start":{"type":"string","format":"date","title":"Start"},"end":{"type":"string","format":"date","title":"End"}},"type":"object","required":["start","end"],"title":"DateRange"},"TrainingDataMetrics":{"properties":{"date_range":{"$ref":"#/components/schemas/DateRange"},"missing_pct":{"type":"number","maximum":100,"minimum":0,"title":"Missing Pct","default":0},"missing_dates":{"anyOf":[{"items":{"type":"string","format":"date"},"type":"array"},{"type":"null"}],"title":"Missing Dates"}},"type":"object","required":["date_range"],"title":"TrainingDataMetrics"},"Readiness":{"properties":{"status":{"$ref":"#/components/schemas/ReadinessStatus"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["status"],"title":"Readiness"},"ReadinessStatus":{"type":"string","enum":["created","failed","forecasting","preparing","ready","stale","training"],"title":"ReadinessStatus"},"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}":{"get":{"tags":["Models"],"summary":"Get Model","operationId":"get_model_models__model_id__get","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetModelResponse"}}}},"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)
