Skip to content

Basic request

The smallest useful call to /v1/ads is just the player identity. This is the baseline every player must support.

GET /v1/ads?playerid=screen-01&key=retailer-acme
Param Required Description
playerid yes The player’s device id, scoped by key.
key yes Retailer scope for playerid.

The server selects using whatever it already knows about the device: its configuration (location, zone, ad networks, supported formats) and any audience context previously pushed for it out-of-band via /adsignals (see When signals apply). It returns a fully targeted decision when context exists, or an empty <VAST/> when nothing is eligible (or the device’s context is still warming). See Response.

On top of the required playerid + key identity, the request takes these optional parameters:

GET /v1/ads?playerid=<player_id>&key=<retailer_key>[&limit=<N>][&source=<SRC>...] HTTP/1.1
Param Required Description
limit no How many ads. Online default 1; a higher value returns a pod to play in order. Offline, the default is our maximum, and a smaller limit requests fewer. A value above the maximum is clamped.
source no Restrict the response to one or more source types: SOURCE_TYPE_AD_SERVER, SOURCE_TYPE_SSP, SOURCE_TYPE_CMS. Repeatable (&source=SOURCE_TYPE_SSP&source=SOURCE_TYPE_CMS); multiple values are OR’d. The response can then have fewer ads than limit, or none. Default: all sources. Offline, the player keeps its source mix by grouping stored ads by source_id.
retail_grocery_zone no The grocery zone the player currently is in, e.g. VENUE_RETAIL_GROCERY_CHECK_OUT. Single-valued; mutually exclusive with retail_mall_zone; requires SENSOR_LOCATION; online only. See Position.
retail_mall_zone no The mall zone the player currently is in, e.g. VENUE_RETAIL_MALLS_FOOD_COURT. Single-valued; mutually exclusive with retail_grocery_zone; requires SENSOR_LOCATION; online only. See Position.
aisle no The grocery product aisle the player currently is at, e.g. AISLE_DAIRY. Single-valued; requires SENSOR_LOCATION; online only. Implies the grocery Aisles zone. See Position.

The offline parameter selects one of two modes:

offline=false (or omitted). Ask for an ad to play right now, in the next slot.

  • Returns 1 ad by default; a higher limit returns a pod: several ads to play in order in one break.
  • These ads are for imminent playback, not to be stored and played later. To hold ads for later, pre-fetch with offline=true.
GET /v1/ads?playerid=screen-01&key=retailer-acme

offline=true. Ask for the full eligible playlist to store on the player and rotate through over time.

  • Returns up to our maximum; a smaller limit requests fewer.
  • These ads are built to be stored and played later. For how to store and rotate them, see Operating offline.
GET /v1/ads?playerid=screen-01&key=retailer-acme&offline=true

The mode decides what several ads mean.

  • Online, they are a pod. Each <Ad> carries a sequence attribute. Play them in that order, one per slot, starting with the next slot, and do not store them for later.
  • Offline, they are a set to choose from. They have no sequence. Store the set and rotate through it over time. Two ads may belong to one flight. Each has its own creative and its own tracking, but a frequency cap counts across them. See Several ads may share one flight and Enforcing frequency caps offline.

Two terms to keep separate:

Term What it means
Playlist The set of ads the player stores.
Creative Each ad’s <MediaFile> bytes that the player downloads.

Every request returns 200 OK with a VAST 4.2 XML document (Content-Type: application/xml). The body holds zero or more <Ad> elements.

To get a smaller response, send Accept-Encoding: gzip or br. The response then comes compressed, with a matching Content-Encoding header. Most HTTP clients send this header and decompress on their own. If you set the header yourself, decompress the body before you parse it. Offline responses gain the most, because they carry many ads.

Each ad references a creative in one of three formats:

Format <MediaFile type>
Video video/mp4
Image image/png, image/jpeg
HTML5 application/zip

Dispatch on the <MediaFile type> attribute to decide how to render each ad. For the full list and rendering rules, see Creative formats.

An empty document — <VAST version="4.2"></VAST> with zero <Ad> elements — means no-fill. It is a normal outcome, not an error, and the player should always respond the same way: play from its stored playlist.

A correctly registered screen receives an empty response whenever:

  • no ad is currently eligible for it, or
  • its audience context is still warming, or
  • the playerid is unknown or not yet registered.

There is no separate “unknown player” status and no 404 — every one of these cases is an empty 200. Treat any empty response as “play from the stored playlist.”

See the Ads API reference for a full response example and schema.

HTTP Meaning The player’s action
200 Success (may be empty <VAST/>) Play, or fall back to playlist
400 Validation failure, e.g. missing playerid/key; dvactid/seg/products/a position with offline=true; a malformed seg/products value, an unsupported or unknown seg segment, seg on a device with no demographic sensor, or a zone/aisle combination that is not a valid position Fix the request
429 Rate-limited by the edge Back off and retry; the response carries no Retry-After, so use your own interval with jitter
500 Infrastructure failure Retry with backoff

A 2xx response carries the VAST document. A failure returns a JSON error, in one of two shapes depending on whether the service or the gateway raised it — see Troubleshooting for how to tell them apart and how to read a validation failure.

An unknown, unregistered, or not-yet-warmed playerid does not return an error: the request succeeds with an empty <VAST/> (no-fill). There is no 404 for “unknown player.”

MUST

  • Fire every <Impression> and <Tracking> pixel. With a VAST SDK, disable its built-in firing and drive fires from its progress callbacks.
  • Fire each stamped event at its lifecycle moment and let the platform decide what counts.
  • Append ets (occurrence time) to every fire, and preserve it unchanged when the player replays a buffered fire.
  • Fire the server-stamped URLs verbatim: never strip or rewrite the token.
  • Treat <VAST/> as no-fill; 429 and 5xx as transient (retry with backoff, then fall back to playlist); other 4xx as permanent.
  • Drop expired ads from the playlist at slot time, unless none is left and the player cannot refresh; see When the player cannot refresh.
  • Offline, honor the player’s source mix by grouping stored ads by source_id.
  • Pre-fetch with offline=true on every boot and on a schedule, and do not wait for it to finish before playing; see Caching creatives.
  • If an online ad’s file is not downloaded when its slot starts, play a stored ad instead; see When the file is not there.
  • Bound GET /v1/ads with a client-side timeout at slot time; fall back to the playlist.

MUST NOT

  • Mint or modify the tracking token.
  • Block other ads on one ad’s failure.
  • Fire an <Impression> or <Tracking> URL of an ad that did not play.