Skip to main content
This guide shows how to fetch and browse user profiles with Algolia’s Advanced Personalization API. Use these code snippets to call the API and retrieve user data for segmentation. Exporting an audience lets you group users who share a specific . Use these groups to run focused email or ad campaigns. For example, export users who like camping or hiking. Then send them promotional content about outdoor gear.

Before you begin

Ensure you have a query string builder utility, such as the qs library available in your project.

Fetch user profiles

The Advanced Personalization API exposes an endpoint to retrieve user profiles based on specified parameters. Here’s a function to communicate with this endpoint:
JavaScript
The function takes as parameters an object containing:

Browse user profiles

To iterate through all user profiles and handle pagination automatically, use this function:
JavaScript

Process batches of user profiles

Here’s an example of how to process batches of user profiles:
JavaScript
Segment users by their category:camping affinity and target them with focused strategies. For example, send them an email about a discount on camping products. Find the list of available parameters in the REST API documentation.
Last modified on September 16, 2026