Skip to main content
POST
/
1
/
indexes
/
*
/
recommendations
curl
curl --request POST \
  --url 'https://algolia_application_id.algolia.net/1/indexes/*/recommendations' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
  --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
  --data '{"requests":[{"indexName":"products","threshold":0,"maxRecommendations":30,"queryParameters":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":"lorem","insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"query":"","attributesForFaceting":["author","filterOnly(isbn)","searchable(edition)","afterDistinct(category)","afterDistinct(searchable(publisher))"],"replicas":["virtual(prod_products_price_asc)","dev_products_replica"],"paginationLimitedTo":100,"unretrievableAttributes":["total_sales"],"disableTypoToleranceOnWords":["wheel","1X2BCD"],"attributesToTransliterate":["name","description"],"camelCaseAttributes":["description"],"decompoundedAttributes":{"de":["name"]},"indexLanguages":["ja"],"disablePrefixOnAttributes":["sku"],"allowCompressionOfIntegerArray":false,"numericAttributesForFiltering":["equalOnly(quantity)","popularity"],"separatorsToIndex":"+#","searchableAttributes":["title,alternative_title","author","unordered(text)","emails.personal"],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"},"customNormalization":{"default":{"ä":"ae","ü":"ue"}},"attributeForDistinct":"url","maxFacetHits":10,"keepDiacriticsOnCharacters":"øé","customRanking":["desc(popularity)","asc(price)"],"attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"<em>","highlightPostTag":"</em>","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":"lorem","disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[{"image":{"urls":[{"url":"lorem"}],"title":"lorem"},"link":{"url":"lorem"}}]}},"enableReRanking":true,"reRankingApplyFilter":[[]]},"model":"bought-together","objectID":"test-record-123"}]}'
{
  "results": [
    {
      "abTestID": 123,
      "abTestVariantID": 2,
      "aroundLatLng": "40.71,-74.01",
      "automaticRadius": "<string>",
      "exhaustive": {
        "facetsCount": true,
        "facetValues": true,
        "nbHits": true,
        "rulesMatch": true,
        "typo": true
      },
      "appliedRules": [
        {}
      ],
      "exhaustiveFacetsCount": true,
      "exhaustiveNbHits": true,
      "exhaustiveTypo": true,
      "facets": {
        "category": {
          "food": 1,
          "tech": 42
        }
      },
      "facets_stats": {},
      "index": "indexName",
      "indexUsed": "indexNameAlt",
      "message": "<string>",
      "nbSortedHits": 20,
      "parsedQuery": "george clo",
      "processingTimeMS": 20,
      "processingTimingsMS": {},
      "queryAfterRemoval": "<string>",
      "redirect": {
        "index": [
          {
            "source": "<string>",
            "dest": "<string>",
            "reason": "<string>",
            "succeed": true,
            "data": {
              "ruleObjectID": "<string>"
            }
          }
        ]
      },
      "renderingContent": {
        "facetOrdering": {
          "facets": {
            "order": [
              "<string>"
            ]
          },
          "values": {}
        },
        "redirect": {
          "url": "<string>"
        },
        "widgets": {
          "banners": [
            {
              "image": {
                "urls": [
                  {
                    "url": "<string>"
                  }
                ],
                "title": "<string>"
              },
              "link": {
                "url": "<string>"
              }
            }
          ]
        }
      },
      "serverTimeMS": 20,
      "serverUsed": "c2-uk-3.algolia.net",
      "userData": "<any>",
      "queryID": "a00dbc80a8d13c4565a442e7e2dca80a",
      "_automaticInsights": true,
      "page": 0,
      "nbHits": 20,
      "nbPages": 1,
      "hitsPerPage": 20,
      "hits": [
        {
          "objectID": "test-record-123",
          "_highlightResult": {},
          "_snippetResult": {},
          "_rankingInfo": {
            "filters": 1,
            "firstMatchedWord": 1,
            "geoDistance": 1,
            "geoPrecision": 2,
            "matchedGeoLocation": {
              "lat": 123,
              "lng": 123,
              "distance": 123
            },
            "personalization": {
              "filtersScore": 123,
              "rankingScore": 123,
              "score": 123
            },
            "nbExactWords": 1,
            "nbTypos": 1,
            "promoted": true,
            "proximityDistance": 1,
            "userScore": 123,
            "words": 2,
            "promotedByReRanking": true
          },
          "_distinctSeqID": 123,
          "_score": 50
        }
      ]
    }
  ]
}
Required ACL: search

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Body

application/json

Recommend request body.

requests
(Frequently bought together · object | Related products · object | Trending items · object | Trending facet values · object | Looking similar · object)[]
required

Recommendation request with parameters depending on the requested model.

  • Frequently bought together
  • Looking similar

Response

OK

results
object[]
required
I