openapi: 3.0.0 info: title: IPFS RPC Add Stats 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. In many cases, using this RPC API is preferable to embedding IPFS directly in your program — it allows you to maintain peer connections that are longer lived than your app and you can keep a single IPFS node running instead of several if your app can be launched multiple times. In fact, the `ipfs` CLI commands use this RPC API when operating in online mode.' 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: Stats paths: /api/v0/stats/bitswap: post: operationId: stats/bitswap description: Show some diagnostic information on the bitswap agent. externalDocs: url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-bitswap 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: BlocksSent: DataReceived: DataSent: DupBlksReceived: DupDataReceived: MessagesReceived: Peers: - ProvideBufLen: Wantlist: - /: tags: - Stats /api/v0/stats/bw: post: operationId: stats/bw description: Print IPFS bandwidth information. externalDocs: url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-bw parameters: - name: peer in: query description: Specify a peer to print bandwidth for. schema: type: string - name: proto in: query description: Specify a protocol to print bandwidth for. schema: type: string - name: poll in: query description: Print bandwidth at an interval. schema: type: boolean - name: interval in: query description: 'Time interval to wait between updating output, if ''poll'' is true.This accepts durations such as "300s", "1.5h" or "2h45m". Valid time units are: "ns", "us" (or "µs"), "ms", "s", "m", "h".' schema: type: string default: 1s responses: '200': description: Successful response content: application/json: example: RateIn: RateOut: TotalIn: TotalOut: tags: - Stats /api/v0/stats/dht: post: operationId: stats/dht description: Returns statistics about the node's DHT(s). externalDocs: url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-dht parameters: - name: arg in: query description: The DHT whose table should be listed (wanserver, lanserver, wan, lan). wan and lan refer to client routing tables. When using the experimental DHT client only WAN is supported. Defaults to wan and lan. x-experimental: true schema: type: string responses: '200': description: Successful response content: application/json: example: Buckets: - LastRefresh: Peers: - AgentVersion: Connected: ID: LastQueriedAt: LastUsefulAt: Name: tags: - Stats /api/v0/stats/provide: post: operationId: stats/provide description: Returns statistics about the node's (re)provider system. externalDocs: url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-provide parameters: [] responses: '200': description: Successful response content: application/json: example: AvgProvideDuration: LastReprovideBatchSize: LastReprovideDuration: TotalProvides: tags: - Stats /api/v0/stats/repo: post: operationId: stats/repo description: Get stats for the currently used repo. externalDocs: url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-repo parameters: - name: size-only in: query description: Only report RepoSize and StorageMax. 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: NumObjects: RepoPath: SizeStat: RepoSize: StorageMax: Version: tags: - Stats externalDocs: url: https://docs.ipfs.tech/reference/kubo/rpc/