See also the API reference for more detail.

Usage

‘s browser service navigates intelligently on your behalf, rendering JavaScript, solving CAPTCHAs, and retrying failed requests. The service has a RESTful interface that accepts GET requests at https://‍/browser. Webpages can be localized with geotargeting parameters. They’re retrieved in real time by default or optionally queued for later retrieval. Up to 120 seconds is allotted per real-time API call to accommodate CAPTCHA-solving, multiple retries, and other mitigations.

Authentication

You can access the service by including your secret API token in an Authorization header:
Authorization: Bearer [API token here]
Here’s an example request that uses the common Curl command:
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser'\
  '?url=https://example.com/'

Browsing parameters

Besides the geotargeting and scheduling parameters linked above, required and optional browsing parameters can be added in a standard query string. The keys and values supports are as follows:
KeyRequiredValue
urlThe URL of the page to browse; any unsafe characters require URL encoding
deviceThe name as returned by the devices endpoint of the device to emulate browsing on (these names are case insensitive but must include form- or URL-encoded spaces and punctuation marks); device emulation is unused by default
ipThe type of IP address to browse from, residential, isp, or datacenter; residential is the default IP type
formatThe HTML format to output to, rendered or raw (see details below); rendered is the default format
expirationThe maximum age of cached content in days to accept, where 0 will disable caching; 1 is the default number of days
delayThe number of seconds to inject before snapshotting the browsed content, from .1 to 10 inclusive; no delay is injected by default
sessionAny unique identifier of up to 255 characters (regardless of character encoding); will make best efforts to route calls in the same session to the same egress node
subaccountAny unique identifier of up to 255 characters (regardless of character encoding); will bill calls made from subaccounts separately

Device emulation

The device parameter lets you fetch device-specific content, rather than the default desktop content. For a list of supported smartphone and tablet devices, make a request with your API token and no parameters to https://‍/browser/devices:
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser/devices'
The API will return JSON that contains an alphabetized array of device names:
[
  "Blackberry PlayBook",
  "Blackberry PlayBook landscape",
  "BlackBerry Z30",
  "[Remaining device names here]"
]
Then, pass your device name of choice in to your browsing request:
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser'\
  '?url=https://crackberry.com/'\
  '&device=blackberry+playbook'

Response format

Pages are returned as rendered HTML or raw (unrendered) HTML.

Additional examples

Cachebusting

$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser'\
  '?url=https://api.weather.gov/alerts'\
  '&expiration=0'

Sticky sessions

$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser'\
  '?url=https://www.imdb.com/title/tt0094012'\
  '&session=12345'

Accounting

$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser'\
  '?url=https://www.gutenberg.org/files/3008/3008-h/3008-h.htm'\
  '&subaccount=fubarco+systems'