> For the complete documentation index, see [llms.txt](https://docs.fact-finder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fact-finder.com/api-reference/predbasket.md).

# Predbasket

Operations for predictive basket

## Get predictions

> \<b>Required Roles\</b>: \<em>ApiPublicQueries\</em>

```json
{"openapi":"3.0.1","info":{"title":"FactFinder REST API","version":"v5"},"tags":[{"name":"predbasket","description":"Operations for predictive basket"}],"servers":[{"url":"https://vector-demo.fact-finder.de/fact-finder/","description":"Generated server url"}],"security":[{"basicAuth":[]},{"oAuth2":["public_queries"]},{"apiKey":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"oAuth2":{"type":"oauth2","flows":{"password":{"tokenUrl":"oauth/token","scopes":{"public_queries":"","import":"","database":"","config":"","analytics":"","jobs":"","monitor":"","manage":"","users":""}}}},"apiKey":{"type":"apiKey","name":"X-FF-API-Key","in":"header"}},"schemas":{"PredictiveBasketResult":{"required":["hits"],"type":"object","properties":{"hits":{"type":"array","description":"Records of the predicted products.","items":{"$ref":"#/components/schemas/TypedFlatRecord"}}}},"TypedFlatRecord":{"required":["values"],"type":"object","properties":{"id":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"object","description":"Contains all the fields present in the record and their corresponding values. If variants exists the values of a specific variant (usually the first) are merged into this map."},"description":"Contains all the fields present in the record and their corresponding values. If variants exists the values of a specific variant (usually the first) are merged into this map."}}},"ApiError":{"required":["error"],"type":"object","properties":{"error":{"type":"string","description":"A short error description"},"errorDescription":{"type":"string","description":"A description of the error cause"},"stacktrace":{"type":"array","description":"The stacktrace from the error (will only be transmitted when the query parameter verbose=true was added to the request)","items":{"type":"string"}}},"description":"Contains information which will be returned when an error occurs."}}},"paths":{"/rest/v5/predictivebasket/{channel}":{"get":{"tags":["predbasket"],"summary":"Get predictions","description":"<b>Required Roles</b>: <em>ApiPublicQueries</em>","operationId":"getPredictions","parameters":[{"name":"blacklist","in":"query","description":"IDs of products to exclude from predictions.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"channel","in":"path","description":"The channel","required":true,"schema":{"type":"string"}},{"name":"filter","in":"query","description":"Filters for field values of returned records.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"idsOnly","in":"query","description":"If the value true is passed, then only the record IDs will be returned, streamlining the results. Additionally, if the Geo module is enabled, the IDs of all markets the product is mapped to will be also included. If you do not need the other information in the results, this will help you to improve performance.","required":false,"schema":{"type":"boolean","default":false}},{"name":"maxResults","in":"query","description":"Limit for the amount of predictions to return.","required":false,"schema":{"minimum":0,"type":"integer","format":"int32","default":0}},{"name":"purchaserId","in":"query","description":"Use this parameter to pass the purchaser ID. This ID is only needed, if the 'Customer-Specific Info' module is active. Otherwise it will be ignored.","required":false,"schema":{"type":"string"}},{"name":"userId","in":"query","description":"This parameter contains a unique user identifier. It is essential for predictive basket results.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictiveBasketResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fact-finder.com/api-reference/predbasket.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
