---
updatedAt: 2025-08-28T23:50:37.000Z
agentTools:
  projectIndex: https://docs.scope3.com/llms.txt
---

# Publisher Real-time API

Real-time endpoint that provides low latency access to content classifications for ad serving and programmatic integrations

The publisher real-time API enables low-latency access to Scope3 classifications for an entire page and/or content artifacts adjacent to ad units, formatted for use through Google Ad Manager, Prebid, and other common ad tech services.

# Retrieve Scope3 classifications

## Page level classification

The RTAPI will respond with a list of key/value pairs for the page URL that can be passed into GAM, as well as an encrypted version of this data that can be safely passed into the programmatic ecosystem via header bidding for use in PMPs and curated deals.

## Ad Unit level classification

For each ad unit on the page, the publisher provides a list of adjacent artifacts. For instance, in an infinite scroll, the adjacent content might be the two posts or articles above and below the ad slot. The RTAPI will respond with a list of key/value pairs for each ad slot that can be passed into GAM, as well as an encrypted version of this data that can be safely passed into the programmatic ecosystem via header bidding for use in PMPs and curated deals.

## Inputs

The input to the RTAPI should be a JSON object (protobuf also supported).

<HTMLBlock>{`
<table style="width: 100%; border-collapse: collapse;">
<thead>
<tr>
  <th style="border: 1px solid #ddd; padding: 8px;">Field</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Value</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Required</th>
</tr>
</thead>
<tbody>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>url</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The URL of the page</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>✅ Required</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>lastUpdateTime</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The datetime (in UTC timezone) when the content of the page was last updated - useful to help Scope3 know to re-classify the page since updates were made.  </p>
<p>Supported Formats: YYYYMMddThh:mm:ss.s, YYYYMMddThh:mm:ss, yyyy/mm/ddThh:mm:ss.s, yyyy/mm/ddThh:mm:ss, yyyy-mm-ddThh:mm:ss.s,yyyy-mm-ddThh:mm:ss</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>ad_units</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>An array of &quot;AdUnit&quot; objects (see below)</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>uvec</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>An array of user segments</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>property_id</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The domain or app ID</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>user_country</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The user&#39;s country (useful for avails and limiting KV response size)</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>user_agent</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The browser user agent - useful for bot detection</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>ip_address</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The user&#39;s IP address - useful for bot detection</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
</tbody>
</table>
`}</HTMLBlock>

### AdUnit Object

| Field                | Value                                                                              | Required   |
| :------------------- | :--------------------------------------------------------------------------------- | :--------- |
| `id`                 | The ad unit ID - should be the same as configured in GAM                           | ✅ Required |
| `adjacent_artifacts` | The list of artifact IDs that are adjacent to the ad unit                          | ✅ Required |
| `transaction_id`     | The ID of the ad impression - used for deduping avails as tracked via programmatic |            |

### Example

```Text JSON
{
  "user_country": "US",
  "url": "http://bigpub.com/an-article",
  "url_last_updated": "2025-01-30T15:26:58",
  "ad_units":
	[
    {
      "id": "/rail/bigsky",
      "adjacent_artifacts": ["2723829183", "/truecrime/big-news-in-local-police"],
      "transaction_id": "12382200183"
    },
    {
      "id": "/takeover/full",
      "adjacent_artifacts": [],
      "transaction_id": "12382200221"
    }
  ]
}
```

<br />

## Outputs

The RTAPI outputs a list of key-values for the page URL and/or each ad unit in the order that they were received, as well as an encrypted version of the same data that can be passed into the Scope3 prebid object.

| Field                      | Value                                                       |
| :------------------------- | :---------------------------------------------------------- |
| `url_classifications `     | Contains an array of key-values to pass to ad tech services |
| `ad_units_classifications` | Array of AdUnitClassificationsResponse objects (see below)  |
| `scope3data`               | Encrypted data sent via prebid                              |

### Example

```json
{
 "url_classifications":
  {
    "keyvals":[
      {
       "key": "scope3_segs",
       "values": ["f1b", "b2j", "p8s"] 
      }
    ]
  },
  "ad_units_classifications":
  [
    {
      "id": "/rail/bigsky",
      "keyvals": [
        {
          "key": "scope3_segs",
          "values": ["f1b", "b2j", "p8s"]
        }
      ]
    }
  ],
  "scope3data": "asdfaflkasjlasdlfjasdfl88232asdfasdf..."
}
```

<br />

# Private Endpoint (proposed)

Each publisher will be configured with a private endpoint that should be added to network configuration from the rendering servers. The endpoint URL will be provided as part of the setup process.

### Metrics and Monitoring

Each publisher endpoint will have a `/metrics` endpoint that provides Prometheus-compatible metrics:

| Metric                     | Type  | Values |
| :------------------------- | :---- | :----- |
| `requests`                 |       |        |
| `segments_returned`        |       |        |
| `bespoke_profiles_active`  | gauge |        |
| `standard_profiles_active` |       |        |
| `response_time_us`         |       |        |