Heista Decode API

Decode any video ad URL into a beat-by-beat structural breakdown.

GitHub OpenAPI

Operations 2

POST /decode Submit a video ad for decoding #
GET /decode/{id} Poll decode job / retrieve completed result #

Specifications

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/heista-co:heista-co-decode-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

heista-co-decode-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Heista Decode API
  version: 1.0.0
  description: 'Creative intelligence as an API. Decode any video ad, extract brand intelligence from any URL or document, generate scripts in any brand''s voice, and browse the decoded corpus for free.


    ## Surfaces

    - **Decode** — turn any video ad URL into a structural formula. Beats, hooks, psychology, visual playbook.

    - **PowerSource** — 14-section brand intelligence from a URL, internal documents, or both.

    - **Adscript** — generate 1–5 ad scripts from a proven structure + a PowerSource. Token-metered.

    - **Files** — upload PDF/DOCX/TXT/MD for use in PowerSource docs mode.

    - **Intelligence reads** — free corpus access (hook patterns, ad formulas, decoded ads).

    - **Account** — credit balance, monthly usage, pricing.


    ## Pricing

    - Decode: **$0.15** (≤60s) / **$0.20** (61–120s)

    - PowerSource: **$1.00** (URL or docs only) / **$2.00** (URL + docs)

    - Adscript: **token-metered**, typically **$0.02–$0.05** per script

    - Intelligence reads, Files API: **free**

    - Failed jobs auto-refund. Duplicate inputs (same org) return cached results at no charge.


    ## Authentication

    Bearer header on every request:

    ```

    Authorization: Bearer hst_live_your_key

    ```

    Production keys are prefixed `hst_live_`; test keys are `hst_test_`. Get yours at heista.co/api-console.


    ## Errors

    All errors follow RFC 9457 Problem Details. The same envelope shape across every endpoint; see the `ProblemDetails` schema.


    Spending-cap and circuit-breaker errors include a `reason` field (`cap_hourly`, `cap_daily`, `cap_monthly`, `cap_key_daily`, `cap_key_monthly`, `circuit_open`). Insufficient-credits errors include `top_up_url`, `current_balance`, and `required` extensions.


    ## Rate limits

    Per API key, per endpoint group. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` (epoch ms). On 429 you also get `Retry-After` (seconds).'
  contact:
    name: Heista Support
    email: support@heista.co
    url: https://heista.co
  termsOfService: https://heista.co/terms
  license:
    name: Proprietary
    url: https://heista.co/terms
servers:
- url: https://www.heista.co/api/v1
  description: Production
- url: http://localhost:3000/api/v1
  description: Local development
security:
- bearerAuth: []
tags:
- name: Decode
  description: Decode any video ad URL into a beat-by-beat structural breakdown.
paths:
  /decode:
    post:
      tags:
      - Decode
      summary: Submit a video ad for decoding
      description: Accepts any public video URL. Reserves the worst-case price up front, runs the multi-agent decoding pipeline in the background, and returns a job ID for polling.
      operationId: submitDecode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecodeSubmitRequest'
      responses:
        '202':
          description: Job accepted (queued)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecodeJobQueued'
        '200':
          description: Deduplicated or idempotent — existing result
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/DecodeJobCompletedRef'
                - $ref: '#/components/schemas/DecodeJobInflightRef'
                - $ref: '#/components/schemas/DecodeJobIdempotentRef'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/CircuitBreaker'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
  /decode/{id}:
    get:
      tags:
      - Decode
      summary: Poll decode job / retrieve completed result
      description: Returns job status while processing; full 5-tab decode report when completed.
      operationId: getDecode
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Job status or completed decode
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/DecodeJobQueued'
                - $ref: '#/components/schemas/DecodeJobProcessing'
                - $ref: '#/components/schemas/DecodeJobCompleted'
                - $ref: '#/components/schemas/DecodeJobFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  responses:
    ValidationError:
      description: Request validation failed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    NotFound:
      description: Resource not found or not owned by this org
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    CircuitBreaker:
      description: 'Account paused (anomaly detection) — `reason: circuit_open`. Review at the API console.'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/SpendingCapProblem'
    InsufficientCredits:
      description: Balance too low. Includes `current_balance`, `required`, and `top_up_url`.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/InsufficientCreditsProblem'
    InternalError:
      description: Internal error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    RateLimited:
      description: Rate limit exceeded. Includes `Retry-After` (seconds).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  schemas:
    DecodeJobFailed:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
          - failed
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
        price:
          type: number
          example: 0
        created_at:
          type: string
          format: date-time
    DecodeJobProcessing:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
          - processing
        estimated_seconds:
          type: integer
        created_at:
          type: string
          format: date-time
    DecodeJobCompleted:
      allOf:
      - type: object
        properties:
          id:
            type: string
            format: uuid
          status:
            type: string
            enum:
            - completed
          price:
            type: number
            description: USD price charged ($0.15 or $0.20).
          created_at:
            type: string
            format: date-time
          completed_at:
            type: string
            format: date-time
      - $ref: '#/components/schemas/DecodeReport'
    DecodeJobIdempotentRef:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
        idempotent:
          type: boolean
          enum:
          - true
        price:
          type: number
          nullable: true
        created_at:
          type: string
          format: date-time
    DecodeJobInflightRef:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
          - queued
          - processing
        deduplicated:
          type: boolean
          enum:
          - true
        price:
          type: number
          nullable: true
        created_at:
          type: string
          format: date-time
        poll_url:
          type: string
    DecodeJobCompletedRef:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
          - completed
        deduplicated:
          type: boolean
          enum:
          - true
        price:
          type: number
          example: 0
        created_at:
          type: string
          format: date-time
        completed_at:
          type: string
          format: date-time
        poll_url:
          type: string
    SpendingCapProblem:
      allOf:
      - $ref: '#/components/schemas/ProblemDetails'
      - type: object
        properties:
          reason:
            type: string
            enum:
            - cap_hourly
            - cap_daily
            - cap_monthly
            - cap_key_daily
            - cap_key_monthly
            - circuit_open
          top_up_url:
            type: string
            format: uri
    InsufficientCreditsProblem:
      allOf:
      - $ref: '#/components/schemas/ProblemDetails'
      - type: object
        properties:
          current_balance:
            type: integer
            description: Current balance in cents
          required:
            type: integer
            description: Cents required for this operation
          top_up_url:
            type: string
            format: uri
            example: https://heista.co/api-console/billing
          resource:
            type: string
            example: decode
    DecodeJobQueued:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
          - queued
        estimated_seconds:
          type: integer
        created_at:
          type: string
          format: date-time
        poll_url:
          type: string
          example: /v1/decode/abc-123
    DecodeReport:
      type: object
      description: Full 5-tab decoded report — video, transcript, patternmap, formula, beats, visual_playbook, psychology, ad_intel, total_beats.
      additionalProperties: true
    DecodeSubmitRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Video URL (Facebook Ad Library, TikTok, Instagram, YouTube, or direct .mp4).
          example: https://www.facebook.com/ads/library/?id=12345
        video_url:
          type: string
          format: uri
          description: Alias of `url`. Use either.
        idempotency_key:
          type: string
          maxLength: 128
          description: Optional. Prevents duplicate charges on retries.
      oneOf:
      - required:
        - url
      - required:
        - video_url
    ProblemDetails:
      type: object
      description: RFC 9457 Problem Details envelope used for every error.
      required:
      - type
      - title
      - status
      properties:
        type:
          type: string
          format: uri
          example: https://api.heista.co/errors/validation-error
        title:
          type: string
          example: Validation error
        status:
          type: integer
          example: 400
        detail:
          type: string
        instance:
          type: string
          format: uri
        request_id:
          type: string
          example: req_a1b2c3d4
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: hst_live_xxx (production) or hst_test_xxx (test)
      description: API key issued at heista.co/api-console.