Methods

Foo API is uses a REST architectural style. In the future we may add more interfaces, but the REST interface will be the original source of truth.

Queue

Lighthouse and Puppeteer browser runs are organized in a queue - a first-in-first-out data structure as described in Wikipedia. By adding to the queue - you can enqueue pages to be audited by Lighthouse for example. API rate limits are on a per page basis, defined by account type. You can find your limit in account management or see all of them in the Plans and Pricing page.

addItems

Adds a page or group of pages to the browser run queue. Each page requires a API token. You can find the token when logged in via the dashboard for the corresponding page.

POST https://www.foo.software/api/v1/queue/items
Adds a page or group of pages to the browser run queue. Each page requires a API token. You can find the token when logged in via the dashboard for the corresponding page.
Payload
Name Description Type Required Default
pages A comma separated list of page api tokens found in the dashboard - one for each page to be enqueued. You can also just provide one. String Yes --
tag An optional tag or name of a performance run (example: build #2 or v0.0.2). String Yes --
Example
curl -X POST "https://www.foo.software/api/v1/queue/items" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"pages\": \"pagetoken1,pagetoken2\", \"tag\": \"build 3\" }"

Example response body

{
  "status": 200,
  "code": "SUCCESS_GENERIC",
  "message": "Success!",
  "namespace": "Route:addQueueItemsPublicApi()",
  "data": {
    "queue": {
      "results": [
        {
          "code": "SUCCESS_QUEUE_ADD",
          "message": "Added to the queue!",
          "status": 200
        },
        {
          "code": "ERROR_PAGE_MISSING",
          "message": "This page does not exist.",
          "status": 422
        }
      ],
      "errors": 1
    }
  }
}

results matching ""

    No results matching ""