egdata API
API ReferenceSearch

Search offers with natural language

Embeds the query with Cloudflare Workers AI, ranks offer vectors in Cloudflare Vectorize, and hydrates each match from canonical Mongo offer documents using its indexed offer ID. Stale vectors that no longer resolve to an offer are omitted.

POST
/search/natural-language

Embeds the query with Cloudflare Workers AI, ranks offer vectors in Cloudflare Vectorize, and hydrates each match from canonical Mongo offer documents using its indexed offer ID. Stale vectors that no longer resolve to an offer are omitted.

Query Parameters

locale?string

Exact BCP-47-style locale used to overlay localized public offer text fields. Defaults to en-US.

Request Body

application/json

Natural-language query and result limit.

TypeScript Definitions

Use the request body type in TypeScript.

query*string

Natural-language description of the desired offers.

Length1 <= length <= 500
topK?integer

Maximum number of Vectorize neighbors to hydrate.

Default10
Range1 <= value <= 50

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/search/natural-language" \  -H "Content-Type: application/json" \  -d '{    "query": "open world co-op survival games"  }'
{  "query": "string",  "count": 0,  "matches": [    {      "score": 0,      "offer": {        "id": "string",        "namespace": "string",        "title": "string",        "description": "string",        "longDescription": "string",        "offerType": "string",        "developerDisplayName": "string",        "publisherDisplayName": "string",        "seller": {          "id": "string",          "name": "string"        },        "tags": [          {}        ],        "offerMappings": [          {}        ],        "productSlug": "string",        "urlSlug": "string",        "url": "string",        "keyImages": [          {            "type": "string",            "url": "http://example.com",            "width": 0,            "height": 0          }        ],        "price": {          "offerId": "string",          "region": "string",          "price": {            "currencyCode": "string",            "originalPrice": 0,            "discountPrice": 0,            "discount": 0          },          "updatedAt": "2019-08-24T14:15:22Z"        },        "releaseDate": "2019-08-24T14:15:22Z",        "lastModifiedDate": "2019-08-24T14:15:22Z",        "locale": "es-ES",        "localeStatus": "canonical",        "canonicalLocale": "en-US",        "localization": {          "source": "string",          "fetchedAt": "2019-08-24T14:15:22Z",          "sourceUpdatedAt": "2019-08-24T14:15:22Z"        }      }    }  ]}
{  "message": "string",  "error": "string"}
{  "message": "string",  "error": "string"}
{  "message": "string",  "error": "string"}
{  "message": "string",  "error": "string"}
{  "message": "string",  "error": "string"}