R

R Downloads API

Package download statistics

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/r-downloads-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

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

OpenAPI Specification

r-downloads-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: METACRAN CranDB Badges Downloads API
  description: CouchDB-backed REST API providing programmatic access to metadata for all CRAN R packages. Enables lookup of package information, version history, dependencies, and maintainer data in JSON format.
  version: 1.0.0
  contact:
    name: METACRAN
    url: https://r-pkg.org
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: https://crandb.r-pkg.org
  description: METACRAN CranDB production server
tags:
- name: Downloads
  description: Package download statistics
paths:
  /downloads/total/{period}/{packages}:
    get:
      operationId: getPackageDownloadTotals
      summary: Get Package Download Totals
      description: Returns the total number of downloads for one or more R packages over the specified time period from the RStudio CRAN mirror.
      tags:
      - Downloads
      parameters:
      - name: period
        in: path
        required: true
        description: Time period for download stats. Use last-day, last-week, last-month, grand-total, or a date range like 2023-01-01:2023-12-31.
        schema:
          type: string
          enum:
          - last-day
          - last-week
          - last-month
          - grand-total
          example: last-week
      - name: packages
        in: path
        required: true
        description: Package name or comma-separated list of package names.
        schema:
          type: string
          example: ggplot2
      responses:
        '200':
          description: Download totals for the specified packages
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DownloadTotal'
  /downloads/daily/{period}/{packages}:
    get:
      operationId: getPackageDownloadDaily
      summary: Get Package Daily Downloads
      description: Returns daily download counts for one or more R packages over the specified time period.
      tags:
      - Downloads
      parameters:
      - name: period
        in: path
        required: true
        description: Time period (last-day, last-week, last-month, or date range)
        schema:
          type: string
          example: last-month
      - name: packages
        in: path
        required: true
        description: Package name or comma-separated list
        schema:
          type: string
          example: dplyr,tidyr
      responses:
        '200':
          description: Daily download counts for the specified packages
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DownloadDaily'
components:
  schemas:
    DownloadTotal:
      type: object
      properties:
        package:
          type: string
          description: R package name
          example: ggplot2
        start:
          type: string
          format: date
          description: Start date of the period
          example: '2024-01-01'
        end:
          type: string
          format: date
          description: End date of the period
          example: '2024-01-07'
        downloads:
          type: integer
          description: Total download count for the period
          example: 142835
    DailyCount:
      type: object
      properties:
        day:
          type: string
          format: date
          description: Date of downloads
          example: '2024-01-15'
        downloads:
          type: integer
          description: Number of downloads on this day
          example: 4821
    DownloadDaily:
      type: object
      properties:
        package:
          type: string
          description: R package name
          example: dplyr
        start:
          type: string
          format: date
          description: Start date of the period
          example: '2024-01-01'
        end:
          type: string
          format: date
          description: End date of the period
          example: '2024-01-31'
        downloads:
          type: array
          description: Daily download counts
          items:
            $ref: '#/components/schemas/DailyCount'