GoatCounter Exports API

The Exports API from GoatCounter — 3 operation(s) for exports.

OpenAPI Specification

goatcounter-exports-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: GoatCounter Exports API
  description: The GoatCounter API can be used to manage sites, users, count pageviews, export raw data, retrieve statistics, and build custom dashboards on top of GoatCounter web analytics.
  version: '0'
  contact:
    name: GoatCounter
    url: https://www.goatcounter.com/
servers:
- url: https://goatcounter.com/api/v0
  description: Hosted GoatCounter (replace host with your site's subdomain)
security:
- bearerAuth: []
tags:
- name: Exports
paths:
  /export:
    post:
      summary: Create CSV export
      description: Start a new export of raw pageview data to CSV.
      operationId: createExport
      tags:
      - Exports
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                start_from_hit_id:
                  type: integer
      responses:
        '202':
          description: Export started.
  /export/{id}:
    get:
      summary: Get export info
      operationId: getExport
      tags:
      - Exports
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Export metadata.
  /export/{id}/download:
    get:
      summary: Download export
      operationId: downloadExport
      tags:
      - Exports
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: CSV export file.
          content:
            text/csv:
              schema:
                type: string
                format: binary
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer