Ga naar hoofdinhoud
SiteProof

API Documentatie

De SiteProof REST API geeft je programmatic toegang tot je websites, scans en issues. Beschikbaar op het Bureau plan.

Authenticatie

Alle API requests vereisen een Bearer token in de Authorization header. Je kunt API keys aanmaken in je dashboard instellingen.

curl -H "Authorization: Bearer sp_live_abc123..." \
  https://siteproof.nl/api/v1/websites

Rate Limiting

De API is gelimiteerd tot 100 requests per minuut per API key. Bij overschrijding ontvang je een 429 status met een Retry-After header.

Response Format

Alle responses zijn JSON. Succesvolle responses bevatten "success": true met een data veld. Foutresponses bevatten "success": false met een error bericht in het Nederlands.

Succes

{
  "success": true,
  "data": { ... }
}

Fout

{
  "success": false,
  "error": "Beschrijving van de fout."
}

Status Codes

CodeBetekenis
200Succesvol
201Aangemaakt
400Ongeldige request
401Niet geauthenticeerd (ongeldige API key)
403Geen toegang (plan ondersteunt geen API)
404Niet gevonden
429Rate limit overschreden
500Server fout
503Scanner niet beschikbaar

Endpoints

GET/api/v1/websites

Lijst van alle websites in je organisatie.

Response

{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "url": "https://example.nl",
      "name": "Example",
      "isActive": true,
      "createdAt": "2025-01-01T00:00:00Z",
      "lastScan": {
        "id": "uuid",
        "score": 85,
        "status": "COMPLETED",
        "totalIssues": 12,
        "createdAt": "2025-01-15T10:00:00Z",
        "completedAt": "2025-01-15T10:02:30Z"
      }
    }
  ]
}
GET/api/v1/websites/:id

Details van een specifieke website, inclusief recente scans en scan planning.

Response

{
  "success": true,
  "data": {
    "id": "uuid",
    "url": "https://example.nl",
    "name": "Example",
    "isActive": true,
    "schedule": {
      "frequency": "WEEKLY",
      "isActive": true,
      "nextRunAt": "2025-01-22T06:00:00Z"
    },
    "recentScans": [...]
  }
}
GET/api/v1/websites/:id/scans

Scan geschiedenis van een website. Ondersteunt paginering.

Query Parameters

ParameterTypeBeschrijving
pagenumberPaginanummer (standaard: 1)
limitnumberResultaten per pagina (standaard: 25, max: 50)

Response

{
  "success": true,
  "data": {
    "scans": [...],
    "pagination": {
      "page": 1,
      "limit": 25,
      "total": 42,
      "totalPages": 2
    }
  }
}
GET/api/v1/websites/:id/issues

Huidige issues van een website (uit de laatste voltooide scan).

Query Parameters

ParameterTypeBeschrijving
severitystringFilter op ernst: CRITICAL, SERIOUS, MODERATE, MINOR
pagenumberPaginanummer (standaard: 1)
limitnumberResultaten per pagina (standaard: 25, max: 100)

Response

{
  "success": true,
  "data": {
    "scanId": "uuid",
    "score": 85,
    "scanDate": "2025-01-15T10:02:30Z",
    "issues": [
      {
        "id": "uuid",
        "axeRuleId": "image-alt",
        "severity": "CRITICAL",
        "wcagCriteria": ["1.1.1"],
        "description": "Afbeeldingen missen alternatieve tekst",
        "fixSuggestion": "Voeg een alt-attribuut toe...",
        "pageUrl": "https://example.nl/about"
      }
    ],
    "pagination": {...}
  }
}
POST/api/v1/scan

Start een nieuwe scan voor een website.

Request Body

{
  "websiteId": "uuid"
}

Response

{
  "success": true,
  "data": {
    "id": "uuid",
    "websiteId": "uuid",
    "status": "QUEUED",
    "createdAt": "2025-01-15T10:00:00Z"
  }
}
GET/api/v1/scan/:id

Status en resultaten van een scan. Poll dit endpoint totdat status COMPLETED of FAILED is.

Response

{
  "success": true,
  "data": {
    "id": "uuid",
    "status": "COMPLETED",
    "score": 85,
    "totalPages": 10,
    "scannedPages": 10,
    "totalIssues": 12,
    "criticalIssues": 2,
    "seriousIssues": 5,
    "moderateIssues": 3,
    "minorIssues": 2,
    "duration": 45,
    "pages": [...],
    "issues": [...]
  }
}

Scan Workflow

Een typische scan-workflow via de API:

  1. Haal je websites op via GET /api/v1/websites
  2. Start een scan via POST /api/v1/scan met het website ID
  3. Poll de scan status via GET /api/v1/scan/:id (elke 5 seconden)
  4. Wanneer de status COMPLETED is, bevat de response alle resultaten
# 1. Lijst websites
curl -H "Authorization: Bearer sp_live_..." \
  https://siteproof.nl/api/v1/websites

# 2. Start scan
curl -X POST \
  -H "Authorization: Bearer sp_live_..." \
  -H "Content-Type: application/json" \
  -d '{"websiteId": "uuid"}' \
  https://siteproof.nl/api/v1/scan

# 3. Poll resultaten
curl -H "Authorization: Bearer sp_live_..." \
  https://siteproof.nl/api/v1/scan/scan-uuid

# 4. Bekijk issues
curl -H "Authorization: Bearer sp_live_..." \
  "https://siteproof.nl/api/v1/websites/uuid/issues?severity=CRITICAL"