Trillboards Ads API

Ad serving endpoints

GitHub OpenAPI

Operations 2

GET /device/{deviceId}/ads Get ads for device #
POST /device/{deviceId}/programmatic-event Record programmatic ad event (Server-side Analytics) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/trillboards-com:trillboards-com-ads-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

trillboards-com-ads-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Trillboards Partner Ads API
  version: 1.1.0
  description: 'API for partner integrations with Trillboards digital advertising platform.


    Use this API to integrate ads into your vending machines, kiosks, digital signage,

    and other display devices. Partners receive competitive revenue share on all impressions.


    ## Authentication


    Most endpoints require API key authentication using Bearer token:

    ```

    Authorization: Bearer trb_partner_xxxxx

    ```


    API keys are generated during partner registration and should be stored securely.


    ## Rate Limits


    All endpoints return rate limit headers:

    - `X-RateLimit-Limit`: Maximum requests allowed per window

    - `X-RateLimit-Remaining`: Requests remaining in current window

    - `X-RateLimit-Reset`: Unix timestamp when window resets

    - `RateLimit-Policy`: IETF draft-7 format policy string


    Rate limits by endpoint type:

    | Endpoint Type | Limit | Window |

    |--------------|-------|--------|

    | Registration | 5 | 1 hour |

    | Authenticated API | 1000 | 1 minute |

    | Ad serving | 100 | 1 minute |

    | Impressions | 500 | 1 minute |

    | Programmatic events | 300 | 1 minute |

    | Batch impressions | 100 | 1 minute |

    | Heartbeat | 60 | 1 minute |

    | Venue intelligence | 100 | 1 minute |

    | Audience intelligence | 100 | 1 minute |

    | Bulk device operations | 20 | 1 minute |


    Exceeding rate limits returns HTTP 429 with a `Retry-After` header.


    ## Quick Start


    **Option A: New Partner Registration**

    1. Register as a partner via `POST /register` (returns API key)

    2. Register your devices

    3. Load the `embed_url` in your device''s WebView or use `/device/{id}/ads` in custom UI

    4. Impressions are tracked automatically


    **Option B: Existing Earner Upgrade**

    If you already have a Trillboards earner account:

    1. Call `POST https://api.trillboards.com/v2/earner/upgrade-to-partner` with your user JWT

    2. Receive your Partner API key (one-time display - save it!)

    3. Your existing screens remain visible alongside new API-registered screens


    ## SDK


    Install the official TypeScript SDK for type-safe integration:

    ```

    npm install @trillboards/ads-sdk

    ```


    The SDK provides 4 entry points:

    - `@trillboards/ads-sdk` — Core browser SDK with ad player, events, and caching

    - `@trillboards/ads-sdk/react` — React hooks and components (TrillboardsProvider, TrillboardsAdSlot)

    - `@trillboards/ads-sdk/react-native` — React Native WebView wrapper

    - `@trillboards/ads-sdk/server` — Node.js PartnerClient with audience, analytics, auctions, creatives


    Full documentation: https://trillboards.com/developers/partner-sdk'
  contact:
    name: Trillboards Developer Support
    email: developers@trillboards.com
    url: https://trillboards.com/developers
  license:
    name: Proprietary
    url: https://trillboards.com/terms-of-service
servers:
- url: https://api.trillboards.com/v1/partner
  description: Production API
- url: http://localhost:4004/v1/partner
  description: Local development
tags:
- name: Ads
  description: Ad serving endpoints
paths:
  /device/{deviceId}/ads:
    get:
      tags:
      - Ads
      summary: Get ads for device
      description: '**SDK Endpoint** - Returns ads for the specified device.


        This endpoint is called by the Trillboards Lite SDK. It supports ETag caching

        to minimize bandwidth usage.


        If header bidding is enabled for the screen, the response includes

        `header_bidding_settings` with a VAST tag URL for programmatic playback.


        No authentication required - device is identified by fingerprint or external device ID.'
      operationId: getAdsForDevice
      parameters:
      - name: deviceId
        in: path
        required: true
        description: Device fingerprint or external device ID
        schema:
          type: string
      - name: If-None-Match
        in: header
        description: ETag from previous response for caching
        schema:
          type: string
      - name: slot_w
        in: query
        description: Actual render slot width in pixels (player truth)
        schema:
          type: integer
      - name: slot_h
        in: query
        description: Actual render slot height in pixels (player truth)
        schema:
          type: integer
      - name: orientation
        in: query
        description: Slot orientation (portrait or landscape)
        schema:
          type: string
          enum:
          - portrait
          - landscape
      - name: muted
        in: query
        description: Whether player is muted (true/false or 1/0)
        schema:
          type: boolean
      - name: autoplay
        in: query
        description: Whether autoplay is allowed (true/false or 1/0)
        schema:
          type: boolean
      - name: ua
        in: query
        description: 'Runtime user agent string from the WebView/browser. Used for CTV device

          detection when stored device metadata is missing. Enables correct dth

          (device type hint) in VAST tags — e.g., Fire TV Silk WebView UA triggers

          dth=4 (CTV) instead of defaulting to dth=2 (desktop).

          '
        schema:
          type: string
          example: Mozilla/5.0 (Linux; Android 9; AFTKA Build/PS7629) AppleWebKit/537.36 Silk/3.23
      responses:
        '200':
          description: Ads list
          headers:
            ETag:
              description: Use in If-None-Match for caching
              schema:
                type: string
                example: '"abc123def456"'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      ads:
                        type: array
                        items:
                          $ref: '#/components/schemas/Ad'
                      settings:
                        $ref: '#/components/schemas/AdSettings'
                      header_bidding_settings:
                        $ref: '#/components/schemas/HeaderBiddingSettings'
                      cache_until:
                        type: string
                        format: date-time
                      screen_id:
                        type: string
                      screen_orientation:
                        type: string
                        enum:
                        - portrait
                        - landscape
                      screen_dimensions:
                        type: object
                        properties:
                          width:
                            type: integer
                          height:
                            type: integer
                          orientation:
                            type: string
                            enum:
                            - portrait
                            - landscape
                      device:
                        type: object
                        properties:
                          fingerprint:
                            type: string
                          display:
                            type: object
              example:
                success: true
                data:
                  ads:
                  - id: 507f1f77bcf86cd799439011
                    title: Summer Sale 50% Off
                    type: image
                    url: https://cdn.trillboards.com/ads/summer-sale.jpg
                    duration: 15
                    impression_url: https://api.trillboards.com/v1/partner/impression?adid=507f1f77bcf86cd799439011&impid={impid}&did={did}&sid={sid}
                    pixel_url: https://api.trillboards.com/openrtb/v1/pixel?adid=507f1f77bcf86cd799439011&impid={impid}&deviceId={fp}
                  - id: 507f1f77bcf86cd799439012
                    title: New Product Launch
                    type: video
                    url: https://cdn.trillboards.com/ads/product-launch.mp4
                    duration: 30
                    impression_url: https://api.trillboards.com/v1/partner/impression?adid=507f1f77bcf86cd799439012&impid={impid}&did={did}&sid={sid}
                    pixel_url: https://api.trillboards.com/openrtb/v1/pixel?adid=507f1f77bcf86cd799439012&impid={impid}&deviceId={fp}
                  settings:
                    ad_interval: 300
                    image_duration: 15
                    sound_enabled: false
                    max_ads_per_hour: 20
                    overlay_button_text: TAP TO CONTINUE
                  header_bidding_settings:
                    enabled: true
                    vast_tag_url: https://pubads.g.doubleclick.net/gampad/ads?...&correlator=123
                    variant_name: simple
                    allocation: 1
                    provider: floodgates
                    request_mode: always
                    force_request: true
                    min_interval_seconds: 60
                    prebid: null
                  cache_until: '2026-01-01T03:00:00.000Z'
                  screen_id: 6507a1b2c3d4e5f6g7h8aa11
                  screen_orientation: landscape
                  screen_dimensions:
                    width: 1920
                    height: 1080
                    orientation: landscape
                  device:
                    fingerprint: P_a1b2c3d4e5f6
                    display:
                      width: 1920
                      height: 1080
        '304':
          description: Not Modified - use cached response
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /device/{deviceId}/programmatic-event:
    post:
      tags:
      - Ads
      summary: Record programmatic ad event (Server-side Analytics)
      description: '**SDK Analytics Endpoint** - Records programmatic ad lifecycle events for

        Trillboards'' internal analytics and triggers partner webhooks when subscribed.


        **Important**: This endpoint is for **server-side event recording only**.

        It does NOT push events to your native Android, iOS, or CTV applications.


        For receiving real-time events in native applications, use the

        **JavaScript Native Bridge Protocol** instead. The SDK automatically sends

        events to standard native interfaces (Android WebView, iOS WKWebView,

        React Native, Flutter, etc.).


        See documentation: https://api.trillboards.com/docs/integrations/partner-native-bridge.md


        ### Events Recorded:

        - `ad_started` - Ad began playing

        - `ad_ended` - Ad finished (complete or skipped)

        - `no_fill` - No programmatic ad available

        - `error` - Ad playback error'
      operationId: recordProgrammaticEvent
      parameters:
      - name: deviceId
        in: path
        required: true
        description: Device fingerprint or external device ID
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - event
              properties:
                event:
                  type: string
                  enum:
                  - ad_started
                  - ad_ended
                  - no_fill
                  - error
                ad_id:
                  type: string
                request_id:
                  type: string
                reason:
                  type: string
                error_code:
                  type: string
                error_message:
                  type: string
                variant_name:
                  type: string
                screen_orientation:
                  type: string
                  enum:
                  - portrait
                  - landscape
                slot_width:
                  type: integer
                slot_height:
                  type: integer
      responses:
        '200':
          description: Event recorded
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
        error:
          type: string
    Ad:
      type: object
      properties:
        id:
          type: string
          description: Advertisement ID
        allocation_id:
          type: string
        type:
          type: string
          enum:
          - video
          - image
        url:
          type: string
          format: uri
          description: Media URL (CDN)
        duration:
          type: integer
          description: Duration in seconds
        title:
          type: string
        impression_url:
          type: string
          format: uri
          description: Call this to record impression
        pixel_url:
          type: string
          format: uri
          description: 1x1 tracking pixel URL
    AdSettings:
      type: object
      properties:
        ad_interval:
          type: integer
        max_ads_per_hour:
          type: integer
        image_duration:
          type: integer
        sound_enabled:
          type: boolean
        overlay_button_text:
          type: string
    HeaderBiddingSettings:
      type:
      - object
      - 'null'
      properties:
        enabled:
          type: boolean
        vast_tag_url:
          type: string
          format: uri
        variant_name:
          type: string
        allocation:
          type: number
        provider:
          type: string
        request_mode:
          type: string
        force_request:
          type: boolean
        min_interval_seconds:
          type: integer
        prebid:
          type:
          - object
          - 'null'
  responses:
    TooManyRequests:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          description: Seconds to wait before retrying
          schema:
            type: integer
            example: 60
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                example: API rate limit exceeded. Maximum 200 requests per minute.
              retryAfter:
                type: integer
                example: 60
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Missing required fields
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Device not found
  headers:
    X-RateLimit-Limit:
      description: The maximum number of requests allowed in the current time window
      schema:
        type: integer
        example: 200
    X-RateLimit-Remaining:
      description: The number of requests remaining in the current time window
      schema:
        type: integer
        example: 199
    X-RateLimit-Reset:
      description: Unix timestamp when the rate limit window resets
      schema:
        type: integer
        example: 1704067260
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key authentication. Include your API key as a Bearer token:

        ```

        Authorization: Bearer trb_partner_xxxxx

        ```

        '
    UserJWT:
      type: http
      scheme: bearer
      description: 'User JWT authentication for earner-to-partner upgrade.

        Used only for the `/v2/earner/upgrade-to-partner` endpoint.

        This is the same JWT token used for the Earner Portal.

        '