# Audience Anywhere API

This API retrieves user audience information for your social logins, enabling you to offer enhanced personalized experiences to your customers across touch points.

Here are some of the main benefits of using Audience Anywhere:

* **Fine tune your landing pages with personalized messaging**: Use audience data (e.g. user belongs to 'Degens') to customize your content with a particular message.
* **Offer personalized incentives and rewards**: Use audience data (e.g. user is in a 'Tier One' audience) to customize rewards based on user's LTV.&#x20;

Currently, the Audience Anywhere API only supports Twitters social login. \
To receive a key and direct the API calls to a particular audience, contact our customer success team. &#x20;

### How does it work?

This API queries whether an individual twitter \[hashed] ID belongs to a particular Addressable audience.&#x20;

Each query returns an empty or populated 'audience\_ids' list. This list provides the IDs of your selected target audience that the user belongs to (at the time of the query).&#x20;

***

### Base URL

`https://api.adrsbl.io/v1`

### Authentication header

* `x-api-key: your_api_Key` (required): Your API key for authentication.

### Endpoints

#### Get Audience Information

**Request**

```bash
curl -X 'GET' \
  'https://api.adrsbl.io/v1/audience_anywhere?social_login=twitter&hashed_user_id=xxxxx' \
  -H 'accept: application/json' \
  -H 'x-api-key: YOUR_API_KEY'
```

* **Method**: GET
* **Endpoint**: /audience\_anywhere
* **Query Parameters**:
  * `social_login` (required): The social login for which you want to retrieve audience information. \
    Currently supports Twitter (X) only.
  * `hashed_user_id` (required): The social login's hashed user ID for which you want to fetch audience information. \
    In the Twitter (X) case, use SHA256 of the Twitter ID (not the handle).

**Response**

The API responds with a JSON object containing a list of one or more audience IDs for which your user belongs to. When the list is returned populated, it means that the queried user was found as belonging to your  pre-determined target audience group (among others). \
When the list is returned empty, it means that the queried user does not belong to your target audience group.&#x20;

Example:&#x20;

```json
{
  "audience_ids": [
    // Empty audience id list
  ]
}
```

```json
{
  "audience_ids": [
    // "622ac0dc9efdd9f9fca6c01a"
  ]
}
```

#### Error Responses

* 401 Authorization Error
* 403 Forbidden: Invalid API key or authentication failure
* 404 Not Found: The requested resource was not found
* 500 Internal Server Error: An unexpected error occurred on the server

### Rate Limiting

This API has rate limiting of 10 calls per second.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://addressable.gitbook.io/knowledge-base/apis/audience-anywhere-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
