Standardized inventory queries
As a selling party, you can add and organize inventory using standardized values for common inventory types. The following standardized fields support common standardized inventory values:
- Ad format
- Browser
- Category
- Content rating
- Device make
- Genre
- Geo segment
- Language
- Mobile carrier
- Operating system
- Venue type
For details on available fields, see Standardized selection objects.
Here's what you need to know about querying each selection value:
- Each selection value has a different object structure associated with it. The values returned follow current inventory standards and may change as those standards evolve.
- The values sent are in alphabetical order and might require cursor pagination for the full list. For details on GraphQL cursors, see GQL API response pagination in the GraphQL Resource Hub.
- To retrieve all fields in the object, the
nodesobject must match the object fields.
The following sections show example queries for each commonly used inventory composition field. To view a list of all possible input values, you can query each field in the PDP API.
Retrieve simple selection values
Some fields are common and have 100 or fewer unique values. For these, the queries are simple to organize and don't require pagination. The following fields are simple selection values:
- Ad formats
- Browsers
- Content ratings
- Operating systems
- Venue types
Ad formats
The following adFormats query shows how to retrieve all valid ad format types.
query GetAllAdFormatsExample {
adFormats {
nodes {
id
name
mediaType
width
height
}
}
}
An example response contains the following AdFormat object.
{
"id": "66",
"name": "Tablet Interstitial Portrait",
"mediaType": "DISPLAY",
"width": 768,
"height": 1024
}
Browsers
The following browsers query shows how to retrieve all supported web browsers.
query GetAllBrowsersExample {
browsers {
nodes {
id
name
}
}
}
An example response contains the following Browser object.
{
"id": "6",
"name": "Chrome"
}
Content ratings
The following contentRatings query shows how to retrieve all valid content rating types.
query GetAllContentRatingsExample {
contentRatings {
nodes {
id
name
}
}
}
An example response contains the following ContentRating object.
{
"id": "fsk-0",
"name": "0 - General Audience"
}
Operating systems
The following operatingSystems query shows how to retrieve all supported operating systems.
query GetAllOperatingSystemsExample {
operatingSystems {
nodes {
id
name
}
}
}
An example response contains the following OperatingSystem object.
{
"id": "4",
"name": "Linux"
}
Venue types
The following venueTypes query shows how to retrieve all valid venue types.
query GetAllVenueTypesExample {
venueTypes {
nodes {
id
name
}
}
}
An example response contains the following VenueType object.
{
"id": "07",
"name": "office_buildings"
}
Retrieve paginated selection values
Some fields contain over 100 values and cannot fit in a single query response. To retrieve these values, you can split each output over multiple queries. The following fields contain more than 100, and in some cases over 1000 unique values:
- Content categories
- Device makes
- Genres
- Geo segment
- Languages
- Mobile carriers
TIP: For outputs with more than 100 items, optimize your queries with cursor pagination as shown in the following sections. For details on GraphQL cursors, see Paginate lists in the GraphQL Resource Hub.
Content categories
Category types have an additional taxonomy input to specify the IAB Content Taxonomy. The following categories query shows how to retrieve all IAB 2.2 category mappings. For details, see IAB content taxonomy mapping: Version 1.0 to 2.2.
TIP: To retrieve values from IAB Content Taxonomy version 1.0, use
IAB_TECH_LAB_CONTENT_TAXONOMY_1_0as the taxonomy value.
query GetCategoriesExample {
categories(
first: 100
input: { taxonomy: IAB_TECH_LAB_CONTENT_TAXONOMY_2_2 }
) {
nodes {
id
name
path
taxonomy
parent {
id
name
}
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
An example response contains the following Category object.
{
"id": "51",
"name": "Young Adult Literature",
"path": "Books and Literature > Young Adult Literature",
"taxonomy": "IAB_TECH_LAB_CONTENT_TAXONOMY_2_2",
"parent": {
"id": "42",
"name": "Books and Literature"
}
}
Device makes
The following deviceMakes query shows how to retrieve all supported device brands and manufacturers.
query GetDeviceMakesExample {
deviceMakes(first: 100) {
nodes {
id
name
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
An example response contains the following DeviceMake object.
{
"id": "11",
"name": "Samsung"
}
Genres
The following genres query shows how to retrieve all supported genres.
query GetGenresExample {
genres(first: 100) {
nodes {
id
name
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
An example response contains the following Genre object.
{
"id": "aud-partic",
"name": "Audience Participation"
}
Geo segments
The following geoSegments query shows how to retrieve all supported geo segments.
NOTE: When querying for geo segments, you can filter geo location type by country, region, or city.
query GetGeoSegmentsExample {
geoSegments(
input: { type: { eq: COUNTRY } },
first: 100
) {
totalCount
nodes {
geoLocationType
id
name
}
}
}
An example response contains the following GeoSegment object.
{
"geoLocationType": "COUNTRY",
"id": "1n7jkq1fce",
"name": "Andorra"
}
Languages
The following languages query shows how to retrieve all supported languages.
query GetLanguagesExample {
languages(first: 100) {
nodes {
id
name
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
An example response contains the following Language object.
{
"id": "11",
"name": "English"
}
Mobile carriers
The following mobileCarriers query shows how to retrieve all suppported mobile carriers.
query GetMobileCarriersExample {
mobileCarriers(first: 100) {
nodes {
id
name
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
An example response contains the following MobileCarrier object.
{
"id": "32",
"name": "AT&T"
}