Skip to content

Fetch Variants

To evaluate a user for you flag you'll want to fetch variants from our remote evaluation servers. You can fetch variants for a user using either the Evaluation REST API or one of our SDKs.

Evaluation REST API

The Evaluation REST API is the fastest way to test your flag without having to install an SDK.

Input your deployment_key and a user_id into the table below. You may either copy the curl command, or press the Fetch Variants button to make the request in the browser.

Potential data changes

This example makes real requests to the API and can potentially change the data in your Amplitude project. We recommend using a development project when testing APIs.

curl --request GET \
     --url 'https://api.lab.amplitude.com/v1/vardata?' \
     --header 'Authorization: Api-Key '

Variable
Description
(Required) The deployment key you created.
(Required) The user ID used to fetch variants. This should be the same user you track exposure for.
Fetch Variants

Result:



SDKs

Experiment SDKs make it even easier to fetch variants for a user. Client-side SDKs are especially useful for storing pre-fetched variants on the client-side for zero latency variant access.


Last update: 2022-06-21