Skip to main content
This page documents an earlier version of the API client. For the latest version, see Browse for records.
Required ACL: browse Use the browse method to get records from an index, for example, to export your index as a backup. To export all records, use an empty query. Use browse instead of search when exporting records from your index, when ranking, or analytics, isn’t important. The Analytics API doesn’t collect data when using browse. Don’t use this method for building a search UI. Use search instead.
You can’t export your indices from the Algolia dashboard, only your index settings, synonyms and rules. For more information, see Export and import your indices.

Ranking

Results are ranked by attributes and custom ranking. For better performance, there is no ranking for:
  • Distinct
  • Typo tolerance
  • Number of matched words
  • Proximity
  • Geo distance

Reduce response size

If you don’t need all attributes, you can reduce the size of the browse response. Use the attributesToRetrieve parameter to declare which attributes you want to retrieve.

Pagination

The API clients return all results without pagination, often via iterators or similar constructs. If you need paginated results from the API, use the /browse HTTP API endpoint.

Examples

Get all records from an index

// Use an API key with `browse` ACL
var client = new SearchClient("YourApplicationID", "YourAPIKey");
var index = client.InitIndex("indexName");

// Get all records as a typed iterator
IndexIterator<Record> indexIterator = index.Browse<Record>(new BrowseIndexQuery {});

for (var record in indexIterator)
{
  Console.WriteLine(record);
}

Get all records with only a few attributes

The objectID attribute is always retrieved.
// Use an API key with `browse` ACL
var client = new SearchClient("YourApplicationID", "YourAPIKey");
var index = client.InitIndex("indexName");

// Get all records, retrieve only `title` and `content` attributes
IndexIterator<T> indexIterator = index.Browse<T>(new BrowseIndexQuery { AttributesToRetrieve = new List<string> { "title", "content" } });

foreach (var record in indexIterator)
{
  Console.WriteLine(record)
}

Parameters

query
string
required
Search query.Use an empty query to fetch all objects.
browseParameters
object
Compatible search parameters. For example:When using browse, the engine overrides these API parameters:When using browse, the pagination parameters hitsPerPage and page are ignored.Personalization isn’t applied to browse requests. The enablePersonalization parameter is ignored.
requestOptions
object
A mapping of request options to send along with the query.

Response

cursor
string
A cursor to retrieve the next chunk of objects. If absent, the end of the index has been reached.
hits
list
Retrieved records.
hitsPerPage
integer
The maximum number of hits returned per page. Present only when the query is empty and the browse is not filtered.
nbHits
integer
Number of objects in the index. Present only when the query is empty and the browse is not filtered.
nbPages
integer
The number of returned pages. Calculation is based on total number of hits (nbHits) divided by the number of hits per page (hitsPerPage), rounded to the nearest highest integer.Present only when the query is empty and the browse is not filtered.
page
integer
Index of the current page (zero-based). Present only when the query is empty and the browse is not filtered.
params
string
URL-encoded search parameters used to filter the results.
processingTimeMS
integer
Time that the server took to process the request, in milliseconds. This does not include network time.
query
string
Query text used to filter the results.

Response as JSON

This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use the getLogs method. Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON
{
  "hits": [
    {
      "firstname": "Jimmie",
      "lastname": "Barninger",
      "objectID": "433"
    }
  ],
  "processingTimeMS": 7,
  "query": "",
  "params": "filters=level%3D20",
  "cursor": "ARJmaWx0ZXJzPWxldmVsJTNEMjABARoGODA4OTIzvwgAgICAgICAgICAAQ=="
}
I