Rates

Content providers may set rates when allowing licensed access to their content. The standard licenses are an agreement between the providers and consumers of the content, and only apply to a single use of that content. A page may have multiple options for licenses, and each one of these may have a different rate for that terms of access.


GEThttps://gateway.tollbit.com/tollbit/dev/v2/rate/<content_path>

Get Rate

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

Required header

  • Name
    TollbitKey
    Type
    string
    Description

    Your API key which can be found in the access page of the dashboard.

Required attributes

  • Name
    content_url
    Type
    string
    Description

    The URL that you want to fetch rates for.

Response

  • Name
    licenseType
    Type
    string
    Description

    The type of license. Currently supports ON_DEMAND_LICENSE, ON_DEMAND_FULL_USE_LICENSE, and CUSTOM_LICENSE.

  • Name
    licensePath
    Type
    string
    Description

    The url to view the license.

  • Name
    permissions
    Type
    string
    Description

    The rights that this license grants (not limited to just this set). Currently support PARTIAL_USE, FULL_USE, and CITATION_REQUIRED.

  • 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.

Request

GET
https://gateway.tollbit.com/tollbit/dev/v2/rate/<content_url>
curl -G https://gateway.tollbit.com/tollbit/dev/v2/rate/<content_url>

Response

[
  {
      "license": {
          "id": "nl1sqiauvujk8i6u507wy2mi",
          "licensePath": "<license_url>",
          "licenseType": "ON_DEMAND_LICENSE",
          "permissions": [
              {
                  "name": "PARTIAL_USE"
              }
          ]
      },
      "price": {
          "currency": "USD",
          "priceMicros": 5000
      }
  },
  {
      "license": {
          "id": "rrmeq2kjsvouhda4ud28uykl",
          "licensePath": "<license_url>",
          "licenseType": "ON_DEMAND_FULL_USE_LICENSE",
          "permissions": [
              {
                  "name": "FULL_USE"
              },
              {
                  "name": "PARTIAL_USE"
              }
          ]
      },
      "price": {
          "currency": "USD",
          "priceMicros": 10000
      }
  },
  ...
]

POSThttps://gateway.tollbit.com/tollbit/dev/v2/rate/batch

Bulk Get Rate

This endpoint allows you get the rates for a list of URLs.

Required header

  • Name
    TollbitKey
    Type
    string
    Description

    Your API key which can be found in the access page of the dashboard.

Required attributes

  • Name
    urls
    Type
    []string
    Description

    A list of URLs that you want to fetch rates for.

Response

  • Name
    url
    Type
    string
    Description

    The url that this set of licenses and rates belong to.

  • 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 supports ON_DEMAND_LICENSE, ON_DEMAND_FULL_USE_LICENSE, and CUSTOM_LICENSE.

  • Name
    licensePath
    Type
    string
    Description

    The url to view the license.

  • Name
    permissions
    Type
    string
    Description

    The rights that this license grants (not limited to just this set). Currently support PARTIAL_USE, FULL_USE, and CITATION_REQUIRED.

Request

POST
https://gateway.tollbit.com/tollbit/dev/v2/rate/batch
  curl --location 'https://gateway.tollbit.com/tollbit/dev/v2/rate/batch' \
  --header 'TollbitKey: YOUR_API_KEY_HERE' \
  --header 'Content-Type: application/json' \
  --data '{
      "urls": [
          "<content_url_1>",
          "<content_url_2>",
          ...
      ]
  }'

Response

[
    {
        "url": "<content_url_1>",
        "rates": [
            {
                "price": {
                    "priceMicros": 5000,
                    "currency": "USD"
                },
                "license": {
                    "cuid": "ji73lwbqjnhfgpu1bk3sjzj1",
                    "licenseType": "ON_DEMAND_LICENSE",
                    "licensePath": "<license_url>",
                    "permissions": [
                        {
                            "name": "PARTIAL_USE"
                        }
                    ]
                }
            },
            {
                "price": {
                    "priceMicros": 10000,
                    "currency": "USD"
                },
                "license": {
                    "cuid": "ec1lhwillyl6i3x4gnb4a6gt",
                    "licenseType": "ON_DEMAND_FULL_USE_LICENSE",
                    "licensePath": "<license_url>",
                    "permissions": [
                        {
                            "name": "FULL_USE"
                        },
                        {
                            "name": "PARTIAL_USE"
                        }
                    ]
                }
            }
        ]
    },
    {
        "url": "<content_url_2>",
        "rates": [
            ...
        ]
    },
    ...
]

Was this page helpful?