# Authentication

Browserlify provides a RESTful API. Token is required, Token can be managed in Console.It is a good way to use different tokens to isolate different types of business.

The Token in the account will share the Credit.

Authentication is through url query with field name token

# Request

API only allows POST method, no extra headers.

For example:

curl -X POST https://api.browserlify.com/scrape?token=YOUR_TOKEN \
    -H 'Content-Type: application/json' \
    -d '{
    "url": "https://example.org",
    "waitLoad": 5000
}'

Usually, it can be generated through the console's GUI tool.

# Response

The default Content-Type is application/json. If you access /pdf, /screenshot, binary stream will be returned.

If asurl, the original result will be stored in the object storage, and a json including the url address of the result will be returned. You can directly access this url address to get your data. This url is private, please do not share it with others.

The url will expire after 48 hours, please download within this time.

curl -X POST https://api.browserlify.com/pdf?token=YOUR_TOKEN \
    -H 'Content-Type: application/json' \
    -d '{
    "url": "https://example.org",
    "waitLoad": 5000,
    "asurl": true
}'

Response example:

{
    "size":41513,
    "url":"https://brlify-us-1303181364.cos.na-siliconvalley.myqcloud.com/pdf/example.org.pdf"
}

# Status Code

HTTP status codes:

  • 200 Everything is ok
  • 400 Invalid parameter
  • 429 Account does not have enough Credit, upgrade subscription plan
  • 502 The destination address is unreachable, the network may be unreachable, or access is restricted
  • 503 Browserlify is overload, try again later