Skip to main content
GET
/
1
/
compositions
curl
curl --request GET \
  --url 'https://algolia_application_id.algolia.net/1/compositions?page=0&hitsPerPage=100' \
  --header 'accept: application/json' \
  --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
  --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'
{
  "items": [
    {
      "objectID": "my_composition_object_id",
      "name": "my lovely crafted composition",
      "behavior": {
        "injection": {
          "main": {
            "source": {
              "search": {
                "index": "Products",
                "params": {
                  "advancedSyntax": false,
                  "advancedSyntaxFeatures": [
                    "exactPhrase",
                    "excludeWords"
                  ],
                  "allowTyposOnNumericTokens": true,
                  "alternativesAsExact": [
                    "ignorePlurals",
                    "singleWordSynonym"
                  ],
                  "analytics": true,
                  "attributeCriteriaComputedByMinProximity": false,
                  "attributesToHighlight": [
                    "author",
                    "title",
                    "conten",
                    "content"
                  ],
                  "attributesToRetrieve": [
                    "author",
                    "title",
                    "content"
                  ],
                  "attributesToSnippet": [
                    "content:80",
                    "description"
                  ],
                  "clickAnalytics": false,
                  "decompoundQuery": true,
                  "disableExactOnAttributes": [
                    "description"
                  ],
                  "disableTypoToleranceOnAttributes": [
                    "sku"
                  ],
                  "distinct": 1,
                  "enableABTest": true,
                  "enablePersonalization": false,
                  "enableReRanking": true,
                  "enableRules": true,
                  "exactOnSingleWordQuery": "attribute",
                  "facetFilters": [
                    [
                      "category:Book",
                      "category:-Movie"
                    ],
                    "author:John Doe"
                  ],
                  "filters": "(category:Book OR category:Ebook) AND _tags:published",
                  "getRankingInfo": false,
                  "highlightPostTag": "</em>",
                  "highlightPreTag": "<em>",
                  "ignorePlurals": [
                    "ca",
                    "es"
                  ],
                  "maxFacetHits": 10,
                  "minProximity": 1,
                  "minWordSizefor1Typo": 4,
                  "minWordSizefor2Typos": 8,
                  "naturalLanguages": [],
                  "numericFilters": [
                    [
                      "inStock = 1",
                      "deliveryDate < 1441755506"
                    ],
                    "price < 1000"
                  ],
                  "optionalFilters": [
                    "category:Book",
                    "author:John Doe"
                  ],
                  "optionalWords": "<string>",
                  "percentileComputation": true,
                  "personalizationImpact": 100,
                  "queryLanguages": [
                    "es"
                  ],
                  "queryType": "prefixLast",
                  "removeStopWords": [
                    "ca",
                    "es"
                  ],
                  "removeWordsIfNoResults": "firstWords",
                  "replaceSynonymsInHighlight": false,
                  "responseFields": [
                    "*"
                  ],
                  "restrictHighlightAndSnippetArrays": false,
                  "restrictSearchableAttributes": [
                    "title",
                    "author"
                  ],
                  "ruleContexts": [
                    "mobile"
                  ],
                  "snippetEllipsisText": "…",
                  "synonyms": true,
                  "typoTolerance": true,
                  "facetingAfterDistinct": false,
                  "facets": {
                    "facetSpecificList": {
                      "summary": "Specify which facet to retrieve with some marked as disjunctive",
                      "value": [
                        [
                          "category",
                          "disjunctive(brand)",
                          "price"
                        ]
                      ]
                    },
                    "facetAll": {
                      "summary": "Retrieve all facets",
                      "value": [
                        [
                          "*"
                        ]
                      ]
                    }
                  },
                  "hitsPerPage": 20,
                  "maxValuesPerFacet": 100,
                  "renderingContent": {
                    "facetOrdering": {
                      "facets": {
                        "order": [
                          "<string>"
                        ]
                      },
                      "values": {}
                    },
                    "redirect": {
                      "url": "<string>"
                    },
                    "widgets": {
                      "banners": [
                        {
                          "image": {
                            "urls": [
                              {
                                "url": "<string>"
                              }
                            ],
                            "title": "<string>"
                          },
                          "link": {
                            "url": "<string>"
                          }
                        }
                      ]
                    }
                  },
                  "sortFacetValuesBy": "count",
                  "sumOrFiltersScores": false
                }
              }
            }
          },
          "injectedItems": [
            {
              "key": "<string>",
              "source": {
                "search": {
                  "index": "Products",
                  "params": {
                    "advancedSyntax": false,
                    "advancedSyntaxFeatures": [
                      "exactPhrase",
                      "excludeWords"
                    ],
                    "allowTyposOnNumericTokens": true,
                    "alternativesAsExact": [
                      "ignorePlurals",
                      "singleWordSynonym"
                    ],
                    "analytics": true,
                    "attributeCriteriaComputedByMinProximity": false,
                    "attributesToHighlight": [
                      "author",
                      "title",
                      "conten",
                      "content"
                    ],
                    "attributesToRetrieve": [
                      "author",
                      "title",
                      "content"
                    ],
                    "attributesToSnippet": [
                      "content:80",
                      "description"
                    ],
                    "clickAnalytics": false,
                    "decompoundQuery": true,
                    "disableExactOnAttributes": [
                      "description"
                    ],
                    "disableTypoToleranceOnAttributes": [
                      "sku"
                    ],
                    "distinct": 1,
                    "enableABTest": true,
                    "enablePersonalization": false,
                    "enableReRanking": true,
                    "enableRules": true,
                    "exactOnSingleWordQuery": "attribute",
                    "facetFilters": [
                      [
                        "category:Book",
                        "category:-Movie"
                      ],
                      "author:John Doe"
                    ],
                    "filters": "(category:Book OR category:Ebook) AND _tags:published",
                    "getRankingInfo": false,
                    "highlightPostTag": "</em>",
                    "highlightPreTag": "<em>",
                    "ignorePlurals": [
                      "ca",
                      "es"
                    ],
                    "maxFacetHits": 10,
                    "minProximity": 1,
                    "minWordSizefor1Typo": 4,
                    "minWordSizefor2Typos": 8,
                    "naturalLanguages": [],
                    "numericFilters": [
                      [
                        "inStock = 1",
                        "deliveryDate < 1441755506"
                      ],
                      "price < 1000"
                    ],
                    "optionalFilters": [
                      "category:Book",
                      "author:John Doe"
                    ],
                    "optionalWords": "<string>",
                    "percentileComputation": true,
                    "personalizationImpact": 100,
                    "queryLanguages": [
                      "es"
                    ],
                    "queryType": "prefixLast",
                    "removeStopWords": [
                      "ca",
                      "es"
                    ],
                    "removeWordsIfNoResults": "firstWords",
                    "replaceSynonymsInHighlight": false,
                    "responseFields": [
                      "*"
                    ],
                    "restrictHighlightAndSnippetArrays": false,
                    "restrictSearchableAttributes": [
                      "title",
                      "author"
                    ],
                    "ruleContexts": [
                      "mobile"
                    ],
                    "snippetEllipsisText": "…",
                    "synonyms": true,
                    "typoTolerance": true
                  }
                }
              },
              "position": 9,
              "length": 10,
              "metadata": {
                "hits": {
                  "addItemKey": true,
                  "extra": {}
                }
              }
            }
          ],
          "deduplication": {
            "positioning": "highest"
          }
        }
      },
      "description": "my lovely crafted composition that is used for X purpose",
      "sortingStrategy": {
        "Price (asc)": "products-low-to-high",
        "Price (desc)": "products-high-to-low"
      }
    }
  ],
  "nbPages": 100,
  "page": 0,
  "hitsPerPage": 20,
  "nbHits": 200
}
Required ACL: editSettings, settings

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.

Query Parameters

page
integer | null

Requested page of the API response. If null, the API response is not paginated.

Required range: x >= 0
hitsPerPage
integer
default:100

Number of hits per page.

Response

OK

items
object[]
required

All compositions in your Algolia application.

nbPages
integer
required

Number of pages.

Example:

100

page
integer
required

Current page.

Example:

0

hitsPerPage
integer
required

Number of items per page.

Example:

20

nbHits
integer
required

Number of items.

Example:

200