Skip to main content
POST
/
utility
/
prefetch
JavaScript
import ContextDev from 'context.dev';

const client = new ContextDev({
  apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});

const response = await client.utility.prefetch({
  identifier: { domain: 'domain' },
  type: 'brand',
});

console.log(response.domain);
{
  "status": "<string>",
  "message": "<string>",
  "type": "brand",
  "domain": "<string>",
  "key_metadata": {
    "credits_consumed": 123,
    "credits_remaining": 123
  }
}
0 Credits Only for Subscribers

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
type
enum<string>
required

What to prefetch. Currently only 'brand' is supported.

Available options:
brand
identifier
By domain · object
required

Identifier of the brand to prefetch. Provide exactly one of domain or email.

timeoutMS
integer

Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).

Required range: 1000 <= x <= 300000

Response

Successful response

status
string

Status of the response, e.g., 'ok'

message
string

Success message

type
enum<string>

The type of prefetch that was queued, echoed from the request (currently always 'brand')

Available options:
brand
domain
string

The domain that was queued for prefetching

key_metadata
object

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.