# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
