# WBAI API

## WhiteBridge AI Agents Network **API**

* **Overview:** The WhiteBridge AI Agents Network API is a powerful tool that provides seamless access to our decentralized data network for developers and businesses. By integrating the API, users can enhance their own applications with real-time people-data intelligence and insights.
* **How It Works:**
  * **Data Access:** Developers can query structured datasets, including public records, social media insights, corporate affiliations, and more.
  * **Custom Integrations:** Build personalized applications using the API to fit specific business or research needs.
  * **Flexible Pricing:** Pay per query or subscribe to access tiers based on usage requirements.
* **Use Case:** Ideal for organizations needing large-scale data enrichment, real-time verification, or advanced analytics capabilities to support decision-making and operational efficiencies.

### Authentication

The WhiteBridge AI Agents NetworkAPI uses API keys to authenticate requests.&#x20;

Every request requires this header: `X-API-Key:`*`Your API Key`*

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

## Errors

WhiteBridge uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the `2xx` range indicate success. Codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the `5xx` range indicate an error with WhiteBridge’s servers (these are rare). Some `4xx` errors that could be handled programmatically include an error code that briefly explains the error reported.

| HTTP Status Code | Description                                                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------ |
| **200**          | Everything worked as expected.                                                                   |
| **400**          | The request was unacceptable, often due to missing a required parameter.                         |
| **401**          | No valid API key provided.                                                                       |
| **402**          | The parameters were valid but the request failed.                                                |
| **404**          | The requested resource doesn’t exist.                                                            |
| **429**          | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
| **500**          | Something went wrong on WhiteBridge’s end.                                                       |

\
Rate Limits
-----------

We strive to provide reliable and efficient service to all our users. To ensure fair usage and maintain optimal performance, we have implemented the following rate limits for our API

* **Requests per Minute**: You are allowed up to **5 API requests per minute**. This applies to Create Lookup endpoint only.

If you exceed this limit, your requests may be throttled, and you will need to wait until the next minute to continue making requests.

## Search

This endpoint allows you to search our decentralized database of people based on a query. The query can be a full name, social media link, phone number or email address.

**GET** `/search`

#### Request <a href="#request" id="request"></a>

| Query Param | Type     | Required | Description                                                                                                     |
| ----------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| **query**   | `string` | Yes      | The search term. Full name, social media link, phone number or email address.                                   |
| **type**    | `string` | Yes      | The social media platform where to search. Supported values: `linkedin`, `facebook`, `instagram`, `x`, `tiktok` |
| **next**    | `string` | No       | Use the `next` value returned from your previous request to paginate through results.                           |

#### Response <a href="#response" id="response"></a>

| Field       | Type             | Description                                                               |
| ----------- | ---------------- | ------------------------------------------------------------------------- |
| **results** | `Candidate[]`    | A list of objects, each representing a candidate.                         |
| **next**    | `string \| null` | Use this value as a cursor to paginate through additional results if any. |
| **status**  | `string`         | The status of the search operation (e.g., "success").                     |

**Candidate Object**

| Field           | Type             | Description                                 |
| --------------- | ---------------- | ------------------------------------------- |
| **candidateId** | `string`         | The unique identifier for the candidate.    |
| **avatarUrl**   | `string \| null` | URL to the candidate's avatar image.        |
| **fullName**    | `string \| null` | The full name of the candidate.             |
| **fragments**   | `string[]`       | Extra details that describes the candidate. |

## Deploy Lookup Agent

This endpoint allows you to deploy an agent to research about a specific person by providing candidate ID

**POST** `/lookups`

#### Request <a href="#request" id="request"></a>

Comment

| Parameter       | Type       | Required | Description                                           |
| --------------- | ---------- | -------- | ----------------------------------------------------- |
| **candidateId** | `string`   | Yes      | The unique identifier for the candidate.              |
| **agent**       | `string[]` | Yes      | A list of agents to include in the lookup report.     |
| **webhookUrl**  | `string`   | No       | The URL to notify when the lookup creation completes. |


---

# 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://docs.whitebridge.network/ecosystem/wbai-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.
