> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adrop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API

> Learn how to request ads server-side using the Adrop REST API.

## Overview

The Adrop REST API allows you to request ads directly from the server-side without using an SDK. This is useful when integrating ads with web servers, backend services, or platforms that don't support SDKs.

## Basic Information

| Item           | Value                          |
| -------------- | ------------------------------ |
| Base URL       | `https://api-v2.adrop.io`      |
| Protocol       | HTTPS                          |
| Authentication | App Key (Authorization header) |

***

## Authentication Setup

An App Key is required to use the API.

### Getting Your App Key

1. Log in to the [Adrop Console](https://console.adrop.io)
2. Navigate to the **Settings** tab
3. Download the platform-specific `adrop_service.json` from the **App** menu
4. Find your App Key in the JSON file

### Authorization Header

Include the `Authorization` header in all API requests:

```
Authorization: YOUR_APP_KEY
```

<Warning>
  Do not share your App Key with anyone.
</Warning>

***

## Common Parameters

### Required Parameters

| Parameter | Type   | Description |
| --------- | ------ | ----------- |
| `unit`    | STRING | Ad unit ID  |

### Recommended Parameters

| Parameter | Type   | Description                        |
| --------- | ------ | ---------------------------------- |
| `uid`     | STRING | User unique identifier             |
| `pf`      | STRING | Platform (`android`, `ios`, `web`) |
| `lcl`     | STRING | Locale (e.g., `en_US`, `ko_KR`)    |

### Optional Parameters

| Parameter   | Type   | Description                        |
| ----------- | ------ | ---------------------------------- |
| `theme`     | STRING | Theme mode (`light`, `dark`)       |
| `adId`      | STRING | Advertising identifier (ADID/IDFA) |
| `contextId` | STRING | Context targeting ID               |

<Note>
  The `uid` parameter is used for controlling ad frequency per user and mapping targeting information. Accurate targeting may not be possible without it.
</Note>

***

## Supported Ad Formats

<CardGroup cols={2}>
  <Card title="Banner Ads" icon="rectangle-ad" href="/sdk/rest-api/banner">
    Returned as HTML for direct web rendering
  </Card>

  <Card title="Native Ads" icon="puzzle-piece" href="/sdk/rest-api/native">
    Returned as structured data for custom UI implementation
  </Card>
</CardGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Targeting Settings" icon="bullseye" href="/sdk/rest-api/targeting">
    User properties and context targeting configuration
  </Card>

  <Card title="Event Tracking" icon="chart-line" href="/sdk/rest-api/event">
    Send user behavior events and track conversions
  </Card>

  <Card title="Error Codes" icon="triangle-exclamation" href="/sdk/rest-api/errors">
    API error codes and troubleshooting
  </Card>
</CardGroup>
