Stashr Stats API

Library-wide counts

GitHub OpenAPI

Operations 1

GET /v1/stats Library stats #

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/stashr-me:stashr-me-stats-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

stashr-me-stats-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: support@stashr.me
    name: Stashr support
    url: https://stashr.me/contact
  description: 'Agent- and CLI-focused access to a user''s Stashr library: search by meaning, read saves in full, save URLs, and manage tags, notes, favorites, and collections. Authenticate with a scoped stashr_ API key (Settings → API keys) or an OAuth token audience-bound to /v1. GET /v1 needs no credential and describes the API. Every response carries X-Request-Id and RateLimit headers (240 requests per minute per account; see RateLimit-Policy). Versioning: the major version is in the path (/v1). Backwards-compatible additions (new fields, endpoints, enum values, filters) ship without a version bump; breaking changes get a new major version, and the old one keeps working for at least 6 months after the replacement ships and is announced with Deprecation and Sunset headers plus a Link rel="deprecation" on the affected endpoints. Deprecation policy: https://stashr.me/docs/api-versioning'
  termsOfService: https://stashr.me/terms
  title: Stashr Stats API
  version: 1.0.0
servers:
- description: Production
  url: https://stashr.me
security:
- bearerAuth: []
tags:
- description: Library-wide counts
  name: Stats
paths:
  /v1/stats:
    get:
      description: 'Aggregate counts over the library: total plus breakdowns by platform, content type, and capture month, honoring the same state parameter and filters as listBookmarks. Answers count questions in one call instead of paging.'
      operationId: getLibraryStats
      parameters:
      - description: 'Which bookmarks to include: active (default), archived, or all'
        in: query
        name: state
        schema:
          default: active
          enum:
          - active
          - archived
          - all
          type: string
      - explode: true
        in: query
        name: authors
        schema:
          items:
            description: An author username ("naval"), optionally platform-scoped ("twitter:naval")
            type: string
          type: array
        style: form
      - explode: true
        in: query
        name: contentTypes
        schema:
          items:
            description: 'A content type ("article"), optionally platform-scoped ("twitter:article"). Valid types: repo, image, post, video, comment, article, page, snippet, event, link, listing'
            type: string
          type: array
        style: form
      - explode: true
        in: query
        name: favorite
        schema:
          items:
            enum:
            - favorite
            - not-favorite
            type: string
          type: array
        style: form
      - explode: true
        in: query
        name: media
        schema:
          items:
            enum:
            - image
            - video
            - any-media
            - text-only
            type: string
          type: array
        style: form
      - explode: true
        in: query
        name: note
        schema:
          items:
            enum:
            - has-note
            - no-note
            type: string
          type: array
        style: form
      - explode: true
        in: query
        name: platforms
        schema:
          items:
            description: Platform id. X/Twitter is "twitter".
            enum:
            - github
            - instagram
            - reddit
            - linkedin
            - tiktok
            - twitter
            - web
            - youtube
            - facebook
            - hackernews
            type: string
          type: array
        style: form
      - explode: true
        in: query
        name: tags
        schema:
          items:
            description: A tag name from /v1/tags
            type: string
          type: array
        style: form
      - explode: true
        in: query
        name: excludeTags
        schema:
          items:
            description: A tag name the bookmark must not have (ANDed with tags/tagMode). "__untagged__" excludes untagged bookmarks
            type: string
          type: array
        style: form
      - in: query
        name: authorMode
        schema:
          default: include
          enum:
          - include
          - exclude
          type: string
      - in: query
        name: contentTypeMode
        schema:
          default: include
          enum:
          - include
          - exclude
          type: string
      - in: query
        name: mediaMode
        schema:
          default: include
          enum:
          - include
          - exclude
          type: string
      - in: query
        name: platformMode
        schema:
          default: include
          enum:
          - include
          - exclude
          type: string
      - in: query
        name: tagMode
        schema:
          default: include_any
          enum:
          - include_any
          - include_all
          - exclude_any
          - exclude_all
          type: string
      - in: query
        name: capturedAfter
        schema:
          description: Only bookmarks saved on/after this ISO-8601 date or datetime (inclusive)
          type: string
      - in: query
        name: capturedBefore
        schema:
          description: Only bookmarks saved before this ISO-8601 date or datetime (exclusive)
          type: string
      - in: query
        name: postedAfter
        schema:
          description: Only bookmarks originally posted on/after this ISO-8601 date or datetime (inclusive). Bookmarks without a known post date are excluded
          type: string
      - in: query
        name: postedBefore
        schema:
          description: Only bookmarks originally posted before this ISO-8601 date or datetime (exclusive). Bookmarks without a known post date are excluded
          type: string
      - in: query
        name: capturedWithin
        schema:
          description: Only bookmarks saved in the last N days, as "<N>d" (1d–3650d), counted in UTC days including today. "7d" = today and the 6 days before
          pattern: ^[1-9][0-9]{0,3}d$
          type: string
      - in: query
        name: postedWithin
        schema:
          description: Only bookmarks originally posted in the last N days, as "<N>d" (1d–3650d), counted in UTC days including today. Bookmarks without a known post date are excluded
          pattern: ^[1-9][0-9]{0,3}d$
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/BookmarkStats'
                required:
                - data
                type: object
          description: Library counts
          headers:
            RateLimit-Policy:
              description: The limiter policy, e.g. "per-minute";q=240;w=60 (quota q per window of w seconds)
              schema:
                type: string
            RateLimit:
              description: Live window state, e.g. "per-minute";r=239;t=58 (r requests remaining, t seconds until reset)
              schema:
                type: string
            RateLimit-Limit:
              schema:
                type: integer
            RateLimit-Remaining:
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets (delta, not epoch)
              schema:
                type: integer
            X-Request-Id:
              description: Echoes the request's X-Request-Id, or a generated id
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Malformed request (error.code bad_request or invalid_json)
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Missing, invalid, or expired credentials (error.code unauthorized)
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: A Pro plan or active trial is required (error.code payment_required)
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: The credential lacks the required scope (error.code forbidden)
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: The resource does not exist or belongs to another account (error.code not_found)
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Validation failed; error.details.issues lists the fields (error.code validation_error)
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Too many requests (error.code rate_limited); wait Retry-After seconds, also given as error.retryAfterMs
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Something failed on Stashr's side (error.code internal_error); retryable
      summary: Library stats
      tags:
      - Stats
components:
  schemas:
    BookmarkStats:
      properties:
        archived:
          type: integer
        byContentType:
          additionalProperties:
            type: integer
          type: object
        byMonth:
          additionalProperties:
            type: integer
          description: Capture counts keyed by "YYYY-MM", newest first
          type: object
        byPlatform:
          additionalProperties:
            type: integer
          type: object
        favorites:
          type: integer
        total:
          type: integer
        untagged:
          type: integer
        withNote:
          type: integer
      required:
      - total
      - byPlatform
      - byContentType
      - byMonth
      - favorites
      - archived
      - untagged
      - withNote
      type: object
    ErrorEnvelope:
      description: The one error shape every 4xx and 5xx response uses. Branch on error.code, show error.message to humans, and retry only when error.retryable is true.
      properties:
        error:
          properties:
            code:
              description: Stable machine-readable code
              enum:
              - bad_request
              - forbidden
              - internal_error
              - invalid_json
              - not_found
              - payment_required
              - rate_limited
              - unauthorized
              - validation_error
              type: string
            details:
              description: 'Code-specific context: validation issues, allowed values, or resolution hints'
            message:
              description: Human-readable explanation
              type: string
            retryAfterMs:
              description: 'Present on 429: how long to wait before retrying, matching the Retry-After header'
              type: integer
            retryable:
              description: True for rate limits and server errors, false for anything the caller must change
              type: boolean
          required:
          - code
          - message
          - retryable
          type: object
        requestId:
          description: Correlates with the X-Request-Id header
          type: string
      required:
      - error
      - requestId
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Stashr OAuth access token or API key
      description: Use an OAuth access token audience-bound to /v1, or a scoped stashr_ API key for non-interactive clients.
      scheme: bearer
      type: http
externalDocs:
  description: Stashr API reference (human docs; add .md for Markdown)
  url: https://stashr.me/docs/api
x-deprecation-policy:
  breakingChanges: Shipped as a new major version (/v2) alongside the old one, never in place
  deprecationSignals:
  - Deprecation header (RFC 9745) with the date it took effect
  - Sunset header (RFC 8594) with the date it stops working
  - 'Link: <migration notes>; rel="deprecation"'
  minimumNoticeMonths: 6
  url: https://stashr.me/docs/api-versioning
  versioning: URL path (/v1)