Skip to main content

Quick Tests API

Quick tests let you run one-off page speed tests against any URL without setting up monitoring.

The Node examples below assume an SDK instance is in scope:

const { DebugBear } = require("debugbear");
const debugbear = new DebugBear(process.env.DEBUGBEAR_API_KEY);

Free-trial accounts can run up to 30 quick tests per day via the API, across all projects in the billing customer.

Trigger one or more quick tests

const { quickTests: pending, waitForResults } = await debugbear.quickTests.run(
projectId,
[
{ url: "https://example.com" },
{ url: "https://example.com/pricing", device: "Desktop" },
],
);

// Optional: wait for every quick test in the batch to finish.
const { quickTests: finished } = await waitForResults();
console.log(finished[0].metrics);

Each test entry takes:

  • url: the URL to test. Bare domains are accepted; the URL is resolved before the test runs.
  • device (optional): name of a device configured on the project (e.g. "Mobile", "Desktop Fast"). Defaults to the project's "Mobile" device if it exists, otherwise the first configured device.
  • region (optional): server region (e.g. us-east, uk). Defaults to us-east.

Using cURL

curl https://www.debugbear.com/api/v1/project/PROJECT_ID/quickTests \
-X POST \
-H "x-api-key: API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url":"https://example.com"}]'

Get a quick test by ID

const qt = await debugbear.quickTests.get(quickTestId);
console.log(qt.hasFinished, qt.metrics);

Using cURL

curl https://www.debugbear.com/api/v1/quickTest/QUICK_TEST_ID \
-X GET \
-H "x-api-key: API_KEY"

The response includes the test data and performance metrics.

{
"id": "129",
"url": "https://www.tesco.com/",
"resultUrl": "https://www.debugbear.com/project/123456/quickTest/AOpvJoEGtzS2umru2DXyCFwa9/overview",
"region": "us-east",
"device": {
"id": "392548",
"name": "Mobile",
"formFactor": "mobile"
},
"hasFinished": true,
"metrics": {
"analysis.date": "2026-05-25T02:04:32.978Z",
"requestTtfb": null,
"performance.ttfb": null,
"...": "..."
},
"createdAt": "2026-05-25T01:46:21.000Z",
"completedAt": "2026-05-25T01:46:43.808Z"
}

Get quick test request waterfall

const requests = await debugbear.quickTests.getRequests(quickTestId);

Using cURL

curl https://www.debugbear.com/api/v1/quickTest/QUICK_TEST_ID/requests \
-X GET \
-H "x-api-key: API_KEY"

Get quick test Lighthouse report

const lhr = await debugbear.quickTests.getLighthouseReport(quickTestId);

Using cURL

curl https://www.debugbear.com/api/v1/quickTest/QUICK_TEST_ID/lhr \
-X GET \
-H "x-api-key: API_KEY"

List quick tests for a project

Returns the most recent quick tests, newest first. Each entry has the URL, region, device, and metrics.

const recent = await debugbear.quickTests.list(projectId);
const moreRecent = await debugbear.quickTests.list(projectId, { limit: 500 });

Returns 100 results by default; the maximum is 1000.

Using cURL

curl https://www.debugbear.com/api/v1/project/PROJECT_ID/quickTests?limit=100 \
-X GET \
-H "x-api-key: API_KEY"