IPFS Bitswap API

The Bitswap API from IPFS — 4 operation(s) for bitswap.

Operations 4

POST /api/v0/bitswap/ledger Bitswap/ledger #
POST /api/v0/bitswap/reprovide Bitswap/reprovide #
POST /api/v0/bitswap/stat Bitswap/stat #
POST /api/v0/bitswap/wantlist Bitswap/wantlist #

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/ipfs-bitswap-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 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

ipfs-bitswap-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: IPFS RPC Bitswap API
  version: v0
  description: When a Kubo IPFS node is running as a daemon, it exposes an HTTP RPC API that allows you to control the node and run the same commands you can from the command line.
  x-providerName: IPFS
  x-logo:
    url: https://raw.githubusercontent.com/ipfs/ipfs-docs/55fe8bc6a53ba3b9023951fb4b432efbbc81fba5/docs/.vuepress/public/images/ipfs-logo.svg
servers:
- description: Local IPFS node
  url: http://localhost:5001
- description: Local IPFS node
  url: http://127.0.0.1:5001
- description: Infura hosted IPFS node
  url: https://ipfs.infura.io:5001
tags:
- name: Bitswap
paths:
  /api/v0/bitswap/ledger:
    post:
      operationId: bitswap/ledger
      description: Show the current ledger for a peer.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-bitswap-ledger
      parameters:
      - name: arg
        in: query
        description: The PeerID (B58) of the ledger to inspect.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Exchanged: <uint64>
                Peer: <string>
                Recv: <uint64>
                Sent: <uint64>
                Value: <float64>
      tags:
      - Bitswap
      summary: Bitswap/ledger
      x-summary-source: derived
  /api/v0/bitswap/reprovide:
    post:
      operationId: bitswap/reprovide
      description: Trigger reprovider.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-bitswap-reprovide
      parameters: []
      responses:
        '200':
          description: Successful response
      tags:
      - Bitswap
      summary: Bitswap/reprovide
      x-summary-source: derived
  /api/v0/bitswap/stat:
    post:
      operationId: bitswap/stat
      description: Show some diagnostic information on the bitswap agent.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-bitswap-stat
      parameters:
      - name: verbose
        in: query
        description: Print extra information.
        schema:
          type: boolean
      - name: human
        in: query
        description: Print sizes in human readable format (e.g., 1K 234M 2G).
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                BlocksReceived: <uint64>
                BlocksSent: <uint64>
                DataReceived: <uint64>
                DataSent: <uint64>
                DupBlksReceived: <uint64>
                DupDataReceived: <uint64>
                MessagesReceived: <uint64>
                Peers:
                - <string>
                ProvideBufLen: <int>
                Wantlist:
                - /: <cid-string>
      tags:
      - Bitswap
      summary: Bitswap/stat
      x-summary-source: derived
  /api/v0/bitswap/wantlist:
    post:
      operationId: bitswap/wantlist
      description: Show blocks currently on the wantlist.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-bitswap-wantlist
      parameters:
      - name: peer
        in: query
        description: Specify which peer to show wantlist for.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Keys:
                - /: <cid-string>
      tags:
      - Bitswap
      summary: Bitswap/wantlist
      x-summary-source: derived
externalDocs:
  url: https://docs.ipfs.tech/reference/kubo/rpc/