IPFS Dht API

The Dht API from IPFS — 6 operation(s) for dht.

Operations 6

POST /api/v0/dht/query Dht/query #
POST /api/v0/dht/findpeer Dht/findpeer #
POST /api/v0/dht/findprovs Dht/findprovs #
POST /api/v0/dht/get Dht/get #
POST /api/v0/dht/provide Dht/provide #
POST /api/v0/dht/put Dht/put #

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-dht-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-dht-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: IPFS RPC Dht 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: Dht
paths:
  /api/v0/dht/query:
    post:
      operationId: dht/query
      description: Find the closest Peer IDs to a given Peer ID by querying the DHT.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dht-query
      parameters:
      - name: arg
        in: query
        description: The peerID to run the query against.
        required: true
        schema:
          type: string
      - name: verbose
        in: query
        description: Print extra information.
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Extra: <string>
                ID: <peer-id>
                Responses:
                - Addrs:
                  - <multiaddr-string>
                  ID: peer-id
                Type: <int>
      tags:
      - Dht
      summary: Dht/query
      x-summary-source: derived
  /api/v0/dht/findpeer:
    post:
      operationId: dht/findpeer
      description: Find the multiaddresses associated with a Peer ID.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dht-findpeer
      deprecated: true
      parameters:
      - name: arg
        in: query
        description: The ID of the peer to search for.
        required: true
        schema:
          type: string
      - name: verbose
        in: query
        description: Print extra information.
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Extra: <string>
                ID: <peer-id>
                Responses:
                - Addrs:
                  - <multiaddr-string>
                  ID: peer-id
                Type: <int>
      tags:
      - Dht
      summary: Dht/findpeer
      x-summary-source: derived
  /api/v0/dht/findprovs:
    post:
      operationId: dht/findprovs
      description: Find peers that can provide a specific value, given a key.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dht-findprovs
      deprecated: true
      parameters:
      - name: arg
        in: query
        description: The key to find providers for.
        required: true
        schema:
          type: string
      - name: verbose
        in: query
        description: Print extra information.
        schema:
          type: boolean
      - name: num-providers
        in: query
        description: The number of providers to find.
        schema:
          type: integer
          default: 20
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Extra: <string>
                ID: <peer-id>
                Responses:
                - Addrs:
                  - <multiaddr-string>
                  ID: peer-id
                Type: <int>
      tags:
      - Dht
      summary: Dht/findprovs
      x-summary-source: derived
  /api/v0/dht/get:
    post:
      operationId: dht/get
      description: Given a key, query the routing system for its best value.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dht-get
      deprecated: true
      parameters:
      - name: arg
        in: query
        description: The key to find a value for.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Extra: <string>
                ID: <peer-id>
                Responses:
                - Addrs:
                  - <multiaddr-string>
                  ID: peer-id
                Type: <int>
      tags:
      - Dht
      summary: Dht/get
      x-summary-source: derived
  /api/v0/dht/provide:
    post:
      operationId: dht/provide
      description: Announce to the network that you are providing given values.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dht-provide
      deprecated: true
      parameters:
      - name: arg
        in: query
        description: The key[s] to send provide records for.
        required: true
        schema:
          type: string
      - name: verbose
        in: query
        description: Print extra information.
        schema:
          type: boolean
      - name: recursive
        in: query
        description: Recursively provide entire graph.
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Extra: <string>
                ID: <peer-id>
                Responses:
                - Addrs:
                  - <multiaddr-string>
                  ID: peer-id
                Type: <int>
      tags:
      - Dht
      summary: Dht/provide
      x-summary-source: derived
  /api/v0/dht/put:
    post:
      operationId: dht/put
      description: Write a key/value pair to the routing system.
      externalDocs:
        url: https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dht-put
      deprecated: true
      parameters:
      - name: arg
        in: query
        description: The key to store the value at.
        required: true
        schema:
          type: string
      requestBody:
        description: Argument `value-file` is of file type. This endpoint expects one or several files (depending on the command) in the body of the request as 'multipart/form-data'.
        content: {}
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                Extra: <string>
                ID: <peer-id>
                Responses:
                - Addrs:
                  - <multiaddr-string>
                  ID: peer-id
                Type: <int>
      tags:
      - Dht
      summary: Dht/put
      x-summary-source: derived
externalDocs:
  url: https://docs.ipfs.tech/reference/kubo/rpc/