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).

FieldValueRequired
urlThe URL of the page✅ Required
lastUpdateTimeThe 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.

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
ad_unitsAn array of "AdUnit" objects (see below)
uvecAn array of user segments
property_idThe domain or app ID
user_countryThe user's country (useful for avails and limiting KV response size)
user_agentThe browser user agent - useful for bot detection
ip_addressThe user's IP address - useful for bot detection

AdUnit Object

FieldValueRequired
idThe ad unit ID - should be the same as configured in GAM✅ Required
adjacent_artifactsThe list of artifact IDs that are adjacent to the ad unit✅ Required
transaction_idThe ID of the ad impression - used for deduping avails as tracked via programmatic

Example

{
  "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"
    }
  ]
}

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.

FieldValue
url_classifications Contains an array of key-values to pass to ad tech services
ad_units_classificationsArray of AdUnitClassificationsResponse objects (see below)
scope3dataEncrypted data sent via prebid

Example

{
 "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..."
}

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:

MetricTypeValues
requests
segments_returned
bespoke_profiles_activegauge
standard_profiles_active
response_time_us