This guide demonstrates how to fetch and browse user profiles using Algolia’s Advanced Personalization API. The provided code snippets offer a straightforward way to interact with the API and retrieve user data for segmentation purposes. Exporting an audience lets you create groups of users who share a specific , so you can run focused email or ad campaigns. For example, you could export an audience of users with a high affinity for camping or hiking and send them promotional content about outdoor gear.Documentation Index
Fetch the complete documentation index at: https://algolia.com/llms.txt
Use this file to discover all available pages before exploring further.
Before you begin
Ensure you have a query string builder utility, such as theqs 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
appId: your AlgoliaapiKey: your Algolia search , withsearch,browse, andrecommendationACLsregion: the Algolia region (for example,"us","eu")- Additional parameters for retrieving user profiles
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
category:camping affinity and implement targeted strategies for these users.
For example, send them an email about a discount on camping products.
Find the list of available parameters in the REST API documentation.