Gajo Analytics API

Click analytics per link. Free gets totals and 7-day history; Basic and Pro get full analytics.

GitHub OpenAPI

Operations 1

GET /urls/{code}/stats Get click analytics for a link #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gajo-io:gajo-io-analytics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gajo-io-analytics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Gajo Analytics API
  version: '1.0'
  summary: Short links, QR codes, click analytics, device routing, A/B split links and app deep links.
  description: 'Gajo is a URL shortener with QR codes, click analytics, device-based routing, A/B split links, and app deep links with an App Store / Google Play fallback. This REST API creates and manages short links and returns their click analytics.


    **Every Gajo account plan includes the core API, including Free (no credit card required).** Create an account, generate a key on the API Keys page, and send it in the `x-api-key` header on every request.


    ## Plans


    | | Free | Basic | Pro |

    |---|---|---|---|

    | Price | $0, no card | $4.99 / month | $9.99 / month |

    | New URLs per month | 50 | 500 | 10,000 |

    | API requests per minute | 10 | 30 | 60 |

    | Max link lifetime | 60 days | 120 days | Unlimited |

    | Generated short code length | 6 characters | 5 characters | 5 characters |

    | `GET /urls/{code}/stats` | Click totals + 7-day history | Full analytics: 90-day history, referrers, devices, countries, regions | Full analytics: full history since the link was created |

    | Batch shortening, editing destinations, routing rules, route & A/B templates, bindings, app deep links | — | — | Yes |


    Operations marked `x-gajo-plan: Pro` return `403` with a message such as `"A Pro plan is required for batch shortening"` on Free and Basic. The monthly URL allowance is shared with links created in the dashboard. Full plan details: gajo.io/pricing.


    ## Responses


    Every response uses the same JSON envelope: `{"success": true|false, "message": string|null, "data": ...}`. On errors `success` is `false` and `message` explains why.


    ## Rate limits


    Each API key may make the plan''s number of requests per 60-second sliding window. Responses carry `X-RateLimit-Limit` and `X-RateLimit-Remaining`; over the limit the API returns `429` with a `Retry-After` header (seconds). `POST /shorten` also returns `429` once the monthly URL allowance is used up.


    Guides and examples: gajo.io/docs.'
  termsOfService: https://gajo.io/terms
  contact:
    name: Gajo
    url: https://gajo.io
servers:
- url: https://gajo.io/api/v1
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Analytics
  description: Click analytics per link. Free gets totals and 7-day history; Basic and Pro get full analytics.
paths:
  /urls/{code}/stats:
    parameters:
    - $ref: '#/components/parameters/ShortCode'
    get:
      operationId: getUrlStats
      tags:
      - Analytics
      summary: Get click analytics for a link
      description: Click analytics for one of your links; bot and link-preview traffic is excluded. Free plans get `totalClicks`, `historyDays` (7) and 7 days of `clicksByDay`. Basic gets 90 days of history and Pro every day since the link was created, plus `topReferrers`, `deviceBreakdown`, `topCountries` and `topRegions`; those four fields are only present on Basic and Pro.
      responses:
        '200':
          description: Click analytics.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UrlStatsResult'
              examples:
                free:
                  summary: Free plan
                  value:
                    success: true
                    message: null
                    data:
                      totalClicks: 318
                      historyDays: 7
                      clicksByDay:
                      - date: '2026-10-01'
                        clicks: 29
                      - date: '2026-10-02'
                        clicks: 44
                      - date: '2026-10-04'
                        clicks: 37
                      - date: '2026-10-06'
                        clicks: 42
                full:
                  summary: Basic or Pro plan
                  value:
                    success: true
                    message: null
                    data:
                      totalClicks: 318
                      historyDays: 90
                      clicksByDay:
                      - date: '2026-09-28'
                        clicks: 12
                      - date: '2026-10-01'
                        clicks: 29
                      - date: '2026-10-06'
                        clicks: 42
                      topReferrers:
                      - source: https://news.ycombinator.com/
                        count: 120
                      - source: Direct
                        count: 88
                      deviceBreakdown:
                      - device: Mobile
                        percentage: 61.2
                      - device: Desktop
                        percentage: 33.5
                      - device: Tablet
                        percentage: 5.3
                      topCountries:
                      - country: United States
                        count: 140
                      - country: Germany
                        count: 37
                      topRegions:
                      - region: California, US
                        count: 51
                      - region: Bavaria, DE
                        count: 14
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccountInactive'
        '404':
          $ref: '#/components/responses/UrlNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  headers:
    X-RateLimit-Remaining:
      description: Requests left in the current 60-second window.
      schema:
        type: integer
        minimum: 0
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        minimum: 1
    X-RateLimit-Limit:
      description: Requests allowed per 60-second sliding window for your plan (10 Free, 30 Basic, 60 Pro).
      schema:
        type: integer
        minimum: 1
  responses:
    RateLimited:
      description: Per-minute rate limit exceeded. Wait `Retry-After` seconds.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResult'
          example:
            success: false
            message: Rate limit exceeded. Please try again later.
    AccountInactive:
      description: 'The key works, but its account isn''t active: it hasn''t been activated yet (open the emailed link, or sign in for a new one), or it was switched off. The message says which.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResult'
          examples:
            notActivated:
              summary: Account not activated yet
              value:
                success: false
                message: This Gajo account isn't activated yet. Open the link we emailed you, or sign in at gajo.io to get a new one.
            switchedOff:
              summary: Account switched off
              value:
                success: false
                message: This Gajo account is switched off. Contact support if you think that's a mistake.
    UrlNotFound:
      description: No link with this code on your account (links belonging to other accounts answer the same way).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResult'
          example:
            success: false
            message: URL not found
            data: null
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
    Unauthorized:
      description: The `x-api-key` header is missing, or the key is unknown or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResult'
          examples:
            missingKey:
              summary: No x-api-key header
              value:
                success: false
                message: Missing x-api-key header
            invalidKey:
              summary: Unknown or revoked key
              value:
                success: false
                message: Invalid API key
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResult'
          examples:
            internal:
              summary: Unexpected error
              value:
                success: false
                message: Internal server error
                data: null
            internalShort:
              summary: Missing record
              value:
                success: false
                message: Internal error
                data: null
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
  schemas:
    UrlStats:
      type: object
      description: Click analytics for one link. Bot traffic (crawlers, link-preview unfurlers, AI fetchers, HTTP libraries) is excluded. Free plans receive `totalClicks`, `historyDays` (7) and `clicksByDay`. Basic receives 90 days of history and Pro every day since the link was created, plus `topReferrers`, `deviceBreakdown`, `topCountries` and `topRegions`, which are omitted entirely on Free.
      required:
      - totalClicks
      - historyDays
      - clicksByDay
      properties:
        totalClicks:
          type: integer
          format: int64
          minimum: 0
          description: All-time human clicks.
        historyDays:
          type: integer
          minimum: 1
          description: 'Days covered by `clicksByDay`: 7 on Free, 90 on Basic, and on Pro every day since the link was created.'
        clicksByDay:
          type: array
          description: Daily click counts, oldest first. Days with no clicks are omitted.
          items:
            type: object
            required:
            - date
            - clicks
            properties:
              date:
                type: string
                format: date
              clicks:
                type: integer
                format: int64
                minimum: 0
        topReferrers:
          type: array
          description: Basic and Pro only. Top 10 referrers; `Direct` when no referrer was sent.
          items:
            type: object
            required:
            - source
            - count
            properties:
              source:
                type: string
              count:
                type: integer
                format: int64
        deviceBreakdown:
          type: array
          description: Basic and Pro only. Share of clicks per device class, as percentages (0-100) summing to 100.
          items:
            type: object
            required:
            - device
            - percentage
            properties:
              device:
                type: string
                examples:
                - Mobile
                - Desktop
                - Tablet
              percentage:
                type: number
                format: double
                minimum: 0
                maximum: 100
        topCountries:
          type: array
          description: Basic and Pro only. Top 10 countries by clicks (country name, or ISO code when the name is unknown).
          items:
            type: object
            required:
            - country
            - count
            properties:
              country:
                type: string
              count:
                type: integer
                format: int64
        topRegions:
          type: array
          description: Basic and Pro only. Top 10 states/provinces, labelled `Region, CC`. May be empty.
          items:
            type: object
            required:
            - region
            - count
            properties:
              region:
                type: string
              count:
                type: integer
                format: int64
    UrlStatsResult:
      description: Envelope with click analytics.
      allOf:
      - $ref: '#/components/schemas/ApiResult'
      - type: object
        required:
        - data
        properties:
          success:
            const: true
          data:
            $ref: '#/components/schemas/UrlStats'
    ApiResult:
      type: object
      description: Envelope shared by every response.
      required:
      - success
      properties:
        success:
          type: boolean
          description: '`true` when the request succeeded.'
        message:
          type:
          - string
          - 'null'
          description: Human-readable status or error message. Often `null` on reads.
        data:
          description: Operation-specific payload; `null` or absent when there is nothing to return.
    ErrorResult:
      type: object
      description: Error envelope. `success` is always `false` and `message` explains the problem.
      required:
      - success
      - message
      properties:
        success:
          const: false
        message:
          type: string
        data:
          type: 'null'
          description: Always `null` (or absent) on errors.
  parameters:
    ShortCode:
      name: code
      in: path
      required: true
      description: Short code of one of your links (the part after `https://gajo.io/` or `https://gajo.io/c/`).
      schema:
        type: string
        pattern: ^[A-Za-z0-9-]{3,50}$
      example: Xk4mPq
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Gajo API key. Generate one on the API Keys page of your account (https://gajo.io/account/keys).
externalDocs:
  description: Gajo API documentation
  url: https://gajo.io/docs