Skip to content
Navigation

Get a campaign

GET
https://whyviral.ai/api/v1/campaigns/{id}

One campaign: its totals, each creator’s posts and alerts, the per-day series and the newest posts that raised an alert. Free.

Authorization

  • bearer
    optional
    HTTP Bearer

    Authorization: Bearer <token>

  • apiKeyHeader
    optional
    API key in header

    x-api-key: <token>

Path parameters

  • id
    string
    required

    The campaign’s id.

    example: "s17e2m8x4c9v0b3n5q7w1r6t2y8u4i0o"

Returns

200

The campaign.

JSON
  • id
    string
    required

    The campaign’s id.

  • object
    string
    required

    "campaign".

  • name
    string
    required

    Its name.

  • status
    active
    or
    ended
    required

    active or ended.

  • required_terms
    array of
    string
    required

    The tags and handles a campaign post must carry.

  • flag_undisclosed
    boolean
    required

    Whether a campaign post without an ad disclosure raises an alert.

  • flag_competitors
    boolean
    required

    Whether a post that names a competitor does.

  • start_at
    required

    The instant the campaign starts: midnight of start_day in its owner’s timezone. Posts since then are read.

    Any of the following:

    • string
    • null
  • start_day
    string
    required

    The start as the calendar day its owner picked, YYYY-MM-DD. Show this one: the UTC date of start_at can be the day before.

    format: date
  • ended_at
    required

    When it was ended, else null.

    Any of the following:

    • string
    • null
  • end_day
    required

    Its last day, YYYY-MM-DD in its owner’s timezone; it ends by itself after a last read. Null without one.

    Any of the following:

    • string
    • null
  • expected_posts
    required

    Campaign posts each creator owes; null when none are expected.

    Any of the following:

    • integer
    • null
  • creators_done
    required

    Creators with that many campaign posts; null when none are expected.

    Any of the following:

    • integer
    • null
  • created_at
    required

    When it was made.

    Any of the following:

    • string
    • null
  • creators
    integer
    required

    Creators in the campaign.

    minimum: 0
  • creators_posted
    integer
    required

    How many of them have a campaign post.

    minimum: 0
  • posts
    integer
    required

    Campaign posts found.

    minimum: 0
  • views
    integer
    required

    Their views at the last read.

    minimum: 0
  • all_posts
    integer
    required

    Every post the creators published since the start.

    minimum: 0
  • alerts
    integer
    required

    Posts that raised an alert.

    minimum: 0
  • last_read_at
    required

    When the creators’ posts were last read.

    Any of the following:

    • string
    • null
  • next_read_at
    required

    When they are read next; null once it ended.

    Any of the following:

    • string
    • null
  • brand
    string
    required

    The project’s brand.

  • creator_list
    array of
    object
    required

    Each creator’s fields with posts, views, all_posts, alerts, last_post_at, read_at, added_at, the required terms their campaign posts carry and lack (used_terms, missing_terms), the alerts they raise (flags) and the newest competitor they name.

    • id
      string
      required
    • platform
      tiktok
      or
      instagram
      or
      youtube
      or
      x
      required
    • handle
      string
      required
    • name
      required

      Any of the following:

      • string
      • null
    • profile_url
      string
      required
      format: uri
    • avatar_url
      required

      Any of the following:

      • string
      • null
    • followers
      required

      Any of the following:

      • integer
      • null
    • country
      required

      Any of the following:

      • string
      • null
    • country_code
      required

      Any of the following:

      • string
      • null
    • posts
      integer
      required
      minimum: 0
    • views
      integer
      required
      minimum: 0
    • all_posts
      integer
      required
      minimum: 0
    • alerts
      integer
      required
      minimum: 0
    • last_post_at
      required

      Any of the following:

      • string
      • null
    • read_at
      required

      Any of the following:

      • string
      • null
    • added_at
      required

      Any of the following:

      • string
      • null
    • used_terms
      array of
      string
      required
    • missing_terms
      array of
      string
      required
    • flags
      array of
      undisclosed
      or
      missing_terms
      or
      competitor
      required
    • competitor
      required

      Any of the following:

      • object
        • name
          string
          required
        • posted_at
          required

          Any of the following:

          • string
          • null
      • null
  • series
    object
    required

    {start_day, days, week_before, last_week}: per UTC day, the brand’s organic mentions and the campaign’s posts, from a week before the start; and the organic mentions before the start and in the last seven days. Its start_day is the UTC day start_at falls on, the one the series counts from.

    • start_day
      string
      required
      format: date
    • days
      array of
      object
      required
      • day
        string
        required
        format: date
      • organic
        integer
        required
        minimum: 0
      • posts
        integer
        required
        minimum: 0
    • week_before
      integer
      required
      minimum: 0
    • last_week
      integer
      required
      minimum: 0
  • alert_posts
    array of
    object
    required

    The newest posts that raised an alert.

    • id
      string
      required

      The post’s id in the campaign.

    • object
      string
      required

      "campaign_post".

    • url
      string
      required

      The post’s link.

      format: uri
    • kind
      video
      or
      slides
      or
      text
      required

      video, slides or text.

    • text
      string
      required

      Its caption or text.

    • cover_url
      required

      A public cover image WhyViral hosts.

      Any of the following:

      • string
      • null
    • platform
      tiktok
      or
      instagram
      or
      youtube
      or
      x
      required

      The platform it is on.

    • posted_at
      required

      When it was published.

      Any of the following:

      • string
      • null
    • views
      required

      Its views at the last read.

      Any of the following:

      • integer
      • null
    • likes
      required

      Its likes.

      Any of the following:

      • integer
      • null
    • campaign
      boolean
      required

      True for a campaign post: it meets the required terms or names the brand, or the owner added or moved it there.

    • names_brand
      boolean
      required

      Whether it names the project’s brand.

    • disclosure
      required

      {how, text, at_sec}: the ad disclosure found, by label, hashtag, said or shown.

      Any of the following:

      • object
        • how
          label
          or
          hashtag
          or
          said
          or
          shown
          required
        • text
          string
          required
        • at_sec
          required

          Any of the following:

          • number
          • null
      • null
    • terms_met
      boolean
      required

      Whether every required term is present.

    • missing_terms
      array of
      string
      required

      The required terms it lacks.

    • used_terms
      array of
      object
      required

      [{term, where}]: where each required term it carries was found; where is caption, shown or said.

      • term
        string
        required
      • where
        caption
        or
        shown
        or
        said
        required
    • moved
      required

      The owner’s own word on whether it is a campaign post; null while its terms decide.

      Any of the following:

      • boolean
      • null
    • added
      boolean
      required

      True when its owner added it by its link.

    • competitor
      required

      {name, where, quote, at, unit}: a competitor it names.

      Any of the following:

      • object
        • name
          string
          required
        • where
          said
          or
          shown
          or
          written
          required
        • quote
          string
          required
        • at
          required

          Any of the following:

          • number
          • null
        • unit
          second
          or
          slide
          or
          line
          required
      • null
    • alerts
      array of
      undisclosed
      or
      missing_terms
      or
      competitor
      required

      undisclosed, missing_terms and competitor; see the table below.

    • watched
      boolean
      required

      True when WhyViral watched it, not only read its text.

    • creator
      object
      required
      • id
        string
        required

        The creator’s id, which /creators/{id} and a report take.

      • platform
        tiktok
        or
        instagram
        or
        youtube
        or
        x
        required

        The platform the account is on.

      • handle
        string
        required

        Their handle, without @.

      • name
        required

        Their display name.

        Any of the following:

        • string
        • null
      • profile_url
        string
        required

        Their profile on the platform.

        format: uri
      • avatar_url
        required

        A public avatar image WhyViral hosts.

        Any of the following:

        • string
        • null
      • followers
        required

        Their follower count, when the platform shows it.

        Any of the following:

        • integer
        • null
      • country
        required

        The country their profile states, as written.

        Any of the following:

        • string
        • null
      • country_code
        required

        That country as an ISO 3166-1 alpha-2 code, when WhyViral recognizes it.

        Any of the following:

        • string
        • null

400

INVALID_REQUEST: The body isn’t JSON, its url is missing or too long, or a parameter has a value it doesn’t take.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

401

INVALID_API_KEY: The key is missing, mistyped or revoked.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

403

ACCOUNT_DISABLED: The key’s account is disabled.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

404

NOT_FOUND: No read, project, creator, campaign or report like this on your account.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

429

RATE_LIMITED: Too many new reads, data requests, searches or report links; wait the Retry-After header’s seconds.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

500

INTERNAL: Something broke on our side; try again.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

Type to search…

↑↓ navigate↵ selectEsc close