Retrieve records

Retrieves one or more records, potentially from different indices.

Records are returned in the same order as the requests.

Usage

Required ACL: search
1
2
3
4
5
6
7
8
import { algoliasearch } from 'algoliasearch';

//
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');

const response = await client.getObjects({
  requests: [{ attributesToRetrieve: ['attr1', 'attr2'], objectID: 'uniqueID', indexName: 'theIndexName' }],
});
Did you find this page helpful?
JavaScript API clients v5