Rates

A rate is the price per access to a certain webpage of content. Content creators set their own rates and every page may have a different rate.

The rate model

Detailed view of the fields in a rate response.

Properties

  • Name
    priceMicros
    Type
    int64
    Description

    The price of the content in micros ($1 = 1,000,000 micros).

  • Name
    currency
    Type
    string
    Description

    The currency in which the price is specified.

  • Name
    licenseType
    Type
    string
    Description

    The type of license. Currently only supports ON_DEMAND_LICENSE.

  • Name
    licensePath
    Type
    string
    Description

    The url to view the license.

  • Name
    error
    Type
    string
    Description

    An error message, if any, encountered during the request.


GET/dev/v1/rate/<content_path>

Get Rate

This endoint allows you to manually ask for the rate of a certain webpage. The <content_path> is simply the full url of the intended webpage.

Optional attributes

  • Name
    <content_path>
    Type
    string
    Description

    The url for which you intend to access the content.

  • Name
    userAgent
    Type
    string
    Description

    Unique AgentID string for who is allowed to access the page. Make sure to use the AgentID that you will use within your application.

Request

GET
/dev/v1/rate/<content_path>
import Tollbit from 'tollbit-sdk'

const client = new Tollbit(SECRET_KEY, ORGANIZATION_ID, USER_AGENT)

const response = await client.getRate("https://joshmayer.net/posts/bix")

Response

[
  {
      "priceMicros": 500000,
      "currency": "USD",
      "licenseType": "ON_DEMAND_LICENSE",
      "licensePath": "https://api.tollbit.com/...",
      "error": ""
  }
]

Was this page helpful?