<div class="section-label"><span class="num">04</span> Results</div>
<div class="section-title">Wait until the forecast is <em>ready</em>.</div>
A language client does this for you. If you call HTTP yourself: POST returns a receipt, then you poll until the forecast is on the response.
Use <span class="mono">job_id</span> and <span class="mono">job_code</span> in the URL. The job is still running while the response is **202**. **200** means it finished. **409** means it failed.
```http
GET https://api.csanalytics.io/v3/rbp-engine/results/{job_id}/{job_code}
```
`GET /jobs/{job_id}/{job_code}` is the same resource. Auth: `x-api-key` header.
## Receipt
A successful POST with one circumstance returns:
| Name | Type | Description |
| --- | --- | --- |
| <span class="mono">job_id</span> | integer | Job id |
| <span class="mono">job_code</span> | string | Job code |
```python
import os, time, requests
base = "https://api.csanalytics.io/v3/rbp-engine"
headers = {"x-api-key": os.environ["CSA_API_KEY"]}
job_id, job_code = 1074, "66cfc21f7effa501"
while True:
r = requests.get(f"{base}/results/{job_id}/{job_code}", headers=headers)
if r.status_code == 202:
time.sleep(2)
continue
r.raise_for_status()
envelope = r.json()
break
```
Several circumstance rows return an [[#Several circumstances|experiment]] instead. Language clients: `wait` / `wait_results` / `waitResults`. [[API/Clients/Introduction|Clients]]
<p> </p>
<div class="section-label"><span class="num">05</span> What you get</div>
```json
{
"job_id": 1074,
"job_code": "66cfc21f7effa501",
"status": "completed",
"results": {
"yhat": [0.1, 0.2, 0.3],
"fit": [0.9],
"insights": {},
"prediction_weights": {}
}
}
```
The forecast is `results.yhat`. Fit sits next to it. Grid jobs also include **Impact on Fit** and **Impact on Prediction**. Names and nested groups match the engine result object: [[Results/Overview|Results]] · [[Results/Grid Insights|Grid Insights]].
<p> </p>
<div class="section-label"><span class="num">06</span> One field</div>
Fetch a single value without the full object:
```http
GET https://api.csanalytics.io/v3/rbp-engine/jobs/{job_id}/{job_code}/{field}
```
Examples: `yhat`, `insights/relevance`. Slashes stay in the path. The body is `{field, json_path, shape, values}`. Still running: **202**. A field larger than 4 MiB: **413**. [[API/Limits/Payload Limits|Payload size]]
<p> </p>
<div class="section-label"><span class="num">07</span> Several circumstances</div>
Several rows of `theta` (`M > 1`) are one POST that becomes M jobs. The receipt has `experiment_id`, `experiment_code`, and a `jobs` list.
```http
GET https://api.csanalytics.io/v3/rbp-engine/experiments/{experiment_id}/{experiment_code}
```
Poll until every child is done. The parent response has compact `yhat` and fit per row. Fetch a child with `/results` for the full object. Quota: one unit per row. [[API/Limits/Throttle Limits|Quota]]
Full HTTP contract: [rbp-engine-api.json](https://github.com/CambridgeSportsAnalytics/rbp-engine-api-client/blob/main/openapi/rbp-engine-api.json).
## Related
- [[API/Introduction|API]] · [[API/Clients/Introduction|Clients]]
- [[API/Endpoints/Grid|Grid]] · [[API/Endpoints/MaxFit|MaxFit]] · [[API/Endpoints/PSR|PSR]]
- [[Results/Overview|Results]] · [[Results/Grid Insights|Grid Insights]]
<div class="btn-row center">
<a class="btn-primary" href="/API/Clients/Introduction">Clients</a>
<a class="btn-ghost" href="/API/Endpoints/Grid">Grid</a>
</div>