Recommend API (1.0.0)
Download OpenAPI specification:Download
API powering the Recommend feature of Algolia.
Get results
Returns recommendations or trending results, for a specific model and objectID
.
Authorizations:
(appIdapiKey)
Request Body schema: application/json
required | Array of baseTrendingRequest (object) or baseRecommendationRequest (object) (recommendationsRequest) The | ||||||||||||||||
Array One of
|
Responses
Request samples
- Payload
Content type
application/json
{- "requests": [
- {
- "model": "trending-facets",
- "facetName": "string",
- "facetValue": "string",
- "indexName": "products",
- "threshold": 100,
- "maxRecommendations": 0,
- "queryParameters": {
- "query": "",
- "similarQuery": "",
- "filters": "",
- "facetFilters": [
- [
- "string"
]
], - "optionalFilters": [
- [
- "string"
]
], - "numericFilters": [
- [
- "string"
]
], - "tagFilters": [
- [
- "string"
]
], - "sumOrFiltersScores": false,
- "facets": [ ],
- "maxValuesPerFacet": 100,
- "facetingAfterDistinct": false,
- "sortFacetValuesBy": "count",
- "page": 0,
- "offset": 0,
- "length": 1,
- "aroundLatLng": "",
- "aroundLatLngViaIP": false,
- "aroundRadius": 1,
- "aroundPrecision": 10,
- "minimumAroundRadius": 1,
- "insideBoundingBox": [
- 0
], - "insidePolygon": [
- 0
], - "naturalLanguages": [ ],
- "ruleContexts": [ ],
- "personalizationImpact": 100,
- "userToken": "string",
- "getRankingInfo": false,
- "clickAnalytics": false,
- "analytics": true,
- "analyticsTags": [ ],
- "percentileComputation": true,
- "enableABTest": true,
- "enableReRanking": true,
- "reRankingApplyFilter": [
- [
- "string"
]
], - "attributesForFaceting": [ ],
- "attributesToRetrieve": [
- "*"
], - "restrictSearchableAttributes": [ ],
- "ranking": [
- "typo",
- "geo",
- "words",
- "filters",
- "proximity",
- "attribute",
- "exact",
- "custom"
], - "customRanking": [ ],
- "relevancyStrictness": 100,
- "attributesToHighlight": [
- "string"
], - "attributesToSnippet": [ ],
- "highlightPreTag": "<em>",
- "highlightPostTag": "</em>",
- "snippetEllipsisText": "…",
- "restrictHighlightAndSnippetArrays": false,
- "hitsPerPage": 20,
- "minWordSizefor1Typo": 4,
- "minWordSizefor2Typos": 8,
- "typoTolerance": true,
- "allowTyposOnNumericTokens": true,
- "disableTypoToleranceOnAttributes": [ ],
- "ignorePlurals": [
- "string"
], - "removeStopWords": [
- "string"
], - "keepDiacriticsOnCharacters": "",
- "queryLanguages": [ ],
- "decompoundQuery": true,
- "enableRules": true,
- "enablePersonalization": false,
- "queryType": "prefixLast",
- "removeWordsIfNoResults": "none",
- "advancedSyntax": false,
- "optionalWords": [ ],
- "disableExactOnAttributes": [ ],
- "exactOnSingleWordQuery": "attribute",
- "alternativesAsExact": [
- "ignorePlurals",
- "singleWordSynonym"
], - "advancedSyntaxFeatures": [
- "exactPhrase",
- "excludeWords"
], - "distinct": true,
- "attributeForDistinct": "string",
- "synonyms": true,
- "replaceSynonymsInHighlight": false,
- "minProximity": 1,
- "responseFields": [ ],
- "maxFacetHits": 10,
- "attributeCriteriaComputedByMinProximity": false,
- "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "property1": {
- "order": [
- "string"
], - "sortRemainingBy": "count"
}, - "property2": {
- "order": [
- "string"
], - "sortRemainingBy": "count"
}
}
}
}
}, - "fallbackParameters": {
- "query": "",
- "similarQuery": "",
- "filters": "",
- "facetFilters": [
- [
- "string"
]
], - "optionalFilters": [
- [
- "string"
]
], - "numericFilters": [
- [
- "string"
]
], - "tagFilters": [
- [
- "string"
]
], - "sumOrFiltersScores": false,
- "facets": [ ],
- "maxValuesPerFacet": 100,
- "facetingAfterDistinct": false,
- "sortFacetValuesBy": "count",
- "page": 0,
- "offset": 0,
- "length": 1,
- "aroundLatLng": "",
- "aroundLatLngViaIP": false,
- "aroundRadius": 1,
- "aroundPrecision": 10,
- "minimumAroundRadius": 1,
- "insideBoundingBox": [
- 0
], - "insidePolygon": [
- 0
], - "naturalLanguages": [ ],
- "ruleContexts": [ ],
- "personalizationImpact": 100,
- "userToken": "string",
- "getRankingInfo": false,
- "clickAnalytics": false,
- "analytics": true,
- "analyticsTags": [ ],
- "percentileComputation": true,
- "enableABTest": true,
- "enableReRanking": true,
- "reRankingApplyFilter": [
- [
- "string"
]
], - "attributesForFaceting": [ ],
- "attributesToRetrieve": [
- "*"
], - "restrictSearchableAttributes": [ ],
- "ranking": [
- "typo",
- "geo",
- "words",
- "filters",
- "proximity",
- "attribute",
- "exact",
- "custom"
], - "customRanking": [ ],
- "relevancyStrictness": 100,
- "attributesToHighlight": [
- "string"
], - "attributesToSnippet": [ ],
- "highlightPreTag": "<em>",
- "highlightPostTag": "</em>",
- "snippetEllipsisText": "…",
- "restrictHighlightAndSnippetArrays": false,
- "hitsPerPage": 20,
- "minWordSizefor1Typo": 4,
- "minWordSizefor2Typos": 8,
- "typoTolerance": true,
- "allowTyposOnNumericTokens": true,
- "disableTypoToleranceOnAttributes": [ ],
- "ignorePlurals": [
- "string"
], - "removeStopWords": [
- "string"
], - "keepDiacriticsOnCharacters": "",
- "queryLanguages": [ ],
- "decompoundQuery": true,
- "enableRules": true,
- "enablePersonalization": false,
- "queryType": "prefixLast",
- "removeWordsIfNoResults": "none",
- "advancedSyntax": false,
- "optionalWords": [ ],
- "disableExactOnAttributes": [ ],
- "exactOnSingleWordQuery": "attribute",
- "alternativesAsExact": [
- "ignorePlurals",
- "singleWordSynonym"
], - "advancedSyntaxFeatures": [
- "exactPhrase",
- "excludeWords"
], - "distinct": true,
- "attributeForDistinct": "string",
- "synonyms": true,
- "replaceSynonymsInHighlight": false,
- "minProximity": 1,
- "responseFields": [ ],
- "maxFacetHits": 10,
- "attributeCriteriaComputedByMinProximity": false,
- "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "property1": {
- "order": [
- "string"
], - "sortRemainingBy": "count"
}, - "property2": {
- "order": [
- "string"
], - "sortRemainingBy": "count"
}
}
}
}
}
}
]
}
Response samples
- 200
- 400
- 402
- 403
- 404
Content type
application/json
{- "results": [
- {
- "abTestID": 0,
- "abTestVariantID": 0,
- "aroundLatLng": "string",
- "automaticRadius": "string",
- "exhaustiveFacetsCount": true,
- "exhaustiveNbHits": true,
- "exhaustiveTypo": true,
- "facets": {
- "category": {
- "food": 1,
- "tech": 42
}
}, - "facets_stats": {
- "property1": {
- "min": 0,
- "max": 0,
- "avg": 0,
- "sum": 0
}, - "property2": {
- "min": 0,
- "max": 0,
- "avg": 0,
- "sum": 0
}
}, - "hitsPerPage": 20,
- "index": "indexName",
- "indexUsed": "indexNameAlt",
- "message": "string",
- "nbHits": 20,
- "nbPages": 1,
- "nbSortedHits": 20,
- "page": 0,
- "params": "query=a&hitsPerPage=20",
- "parsedQuery": "string",
- "processingTimeMS": 20,
- "query": "",
- "queryAfterRemoval": "string",
- "serverUsed": "string",
- "userData": { },
- "renderingContent": {
- "facetOrdering": {
- "facets": {
- "order": [
- "string"
]
}, - "values": {
- "property1": {
- "order": [
- "string"
], - "sortRemainingBy": "count"
}, - "property2": {
- "order": [
- "string"
], - "sortRemainingBy": "count"
}
}
}
}, - "hits": [
- {
- "objectID": "string",
- "_highlightResult": {
- "property1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none",
- "matchedWords": [
- "string"
], - "fullyHighlighted": true
}, - "property2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none",
- "matchedWords": [
- "string"
], - "fullyHighlighted": true
}
}, - "_snippetResult": {
- "property1": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none"
}, - "property2": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none"
}
}, - "_rankingInfo": {
- "filters": 0,
- "firstMatchedWord": 0,
- "geoDistance": 0,
- "geoPrecision": 0,
- "matchedGeoLocation": {
- "lat": 0,
- "lng": 0,
- "distance": 0
}, - "personalization": {
- "filtersScore": 0,
- "rankingScore": 0,
- "score": 0
}, - "nbExactWords": 0,
- "nbTypos": 0,
- "promoted": true,
- "proximityDistance": 0,
- "userScore": 0,
- "words": 0,
- "promotedByReRanking": true
}, - "_distinctSeqID": 0,
- "_score": 100
}
]
}
]
}