GraphQL for Web Auditor

You can use Transcend's GraphQL API to access data from previous Web Auditor runs or to set up new Web Auditor runs.

This is helpful if you want to connect automation systems to the Web Auditor results, or if you plan to schedule runs for all pages from an externally run web crawler.

Explore our GraphQL schema and run queries directly via Transcend's GraphQL Playground. Visit api.transcend.io/graphql or (for users of our US-hosted infrastructure) api.us.transcend.io/graphql. The Docs section in the playground can guide you through the schema exploration.

Here's an example query to list all completed auditor runs. You can filter the filterBy input according to your needs, such as specifying which URL was scanned, detection of errors, etc.

query {
  auditorRuns(
    first: 30
    filterBy: {
      status: Complete
      # urlScanned: "https://transcend.io/"
    }
  ) {
    nodes {
      urlScanned
      auditorScheduleId
      cookiesFileKey
      id
    }
    totalCount
  }
}

This query provides keys regarding cookies and HTTP requests from the scan. To retrieve actual data from a scan, run:

query {
  auditorFileLink(input: {
    auditorRunId: "insert id from previous query",
    fileKey: "insert cookiesFileKey from previous query"
  }) {
    temporaryLink
  }
}```

## Running a Scheduled Job

If you want to schedule a recurring auditor scan, you can run a mutation like this:

```graphql
mutation CreateAuditorSchedule($scheduleStartAt: Date!) {
  createAuditorSchedule(
    input: {
      urlToScan: "https://transcend.io"
      colorScheme: dark
      deviceType: "Desktop Chrome HiDPI"
      browserSteps: "[{\"action\":\"scrollRandomly\"},{\"action\":\"sleep\",\"duration\":3000}]" # Input an array of steps here
      scheduleStartAt: $scheduleStartAt # ISO String, such as `new Date().toISOString()` in node
      scheduleFrequency: "86400000" # One day in milliseconds as a string. Must be a multiple of one day
      region: "California"
    }
  ) {
    results {
      id
      scheduledAt
    }
  }
}

Use this format if you need to specify variables for the date:

{
  "scheduleStartAt": "2024-02-07T19:47:33.353Z"
}