{
  "x402Version": 2,
  "id": 29301,
  "slug": "29301",
  "resource": "https://api.agentstools.dev/docs/snippet",
  "description": "Working code snippets for a library, matched to a topic. Give an ecosystem, package name and a topic or symbol and get the fenced code blocks from the README or docs whose language, code or nearest heading matches, each with a source citation and an honest truncated flag. Ideal for grounding a coding agent in real usage examples.",
  "type": "http",
  "serviceName": "docs-snippet",
  "resourceType": "AI Inference",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xF22e558a00D91Ee12A1F50C52186FecB8dDFf493",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "8000",
      "amountUsd": 0.008,
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "method": "GET",
          "queryParams": {
            "ecosystem": "npm",
            "name": "axios",
            "topic": "request"
          },
          "type": "http"
        },
        "output": {
          "example": {
            "attribution": [
              "npm public registry (registry.npmjs.org)."
            ],
            "capped": true,
            "count": 2,
            "found": true,
            "identity": {
              "ecosystem": "npm",
              "name": "axios",
              "resolved_version": "1.7.9"
            },
            "snippets": [
              {
                "code": "const res = await axios.get('/user?ID=12345')",
                "heading": "Example",
                "language": "js",
                "provenance": {
                  "source": "npm",
                  "source_url": "https://www.npmjs.com/package/axios",
                  "version": "1.7.9"
                },
                "truncated": false
              }
            ],
            "topic": "request"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "method": {
                "enum": [
                  "GET",
                  "HEAD",
                  "DELETE"
                ],
                "type": "string"
              },
              "queryParams": {
                "properties": {
                  "ecosystem": {
                    "description": "Package ecosystem. Aliases accepted: pip and python map to pypi; cargo and rust map to crates; node maps to npm; gh maps to github.",
                    "enum": [
                      "npm",
                      "pypi",
                      "crates",
                      "github"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "description": "Package name; for github pass owner/repo such as coinbase/x402. npm scoped names @scope/name are allowed.",
                    "type": "string"
                  },
                  "symbol": {
                    "description": "Optional symbol name to match, an alias for topic.",
                    "type": "string"
                  },
                  "topic": {
                    "description": "Optional topic or symbol; matched against the README/llms.txt markdown headings, such as authentication or useEffect.",
                    "type": "string"
                  },
                  "version": {
                    "description": "Optional exact version to pin, such as 2.31.0; default is latest.",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "ecosystem"
                ],
                "type": "object"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "docs",
    "code",
    "snippet",
    "example",
    "coding-agent",
    "bazaar"
  ],
  "sourceHost": "api.agentstools.dev",
  "lastUpdated": "2026-10-01T13:30:16.532Z",
  "quality": {
    "calls30d": 2,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-01T13:30:16.273Z"
  },
  "metadata": {
    "serviceName": "docs-snippet",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "method": "GET",
            "queryParams": {
              "ecosystem": "npm",
              "name": "axios",
              "topic": "request"
            },
            "type": "http"
          },
          "output": {
            "example": {
              "attribution": [
                "npm public registry (registry.npmjs.org)."
              ],
              "capped": true,
              "count": 2,
              "found": true,
              "identity": {
                "ecosystem": "npm",
                "name": "axios",
                "resolved_version": "1.7.9"
              },
              "snippets": [
                {
                  "code": "const res = await axios.get('/user?ID=12345')",
                  "heading": "Example",
                  "language": "js",
                  "provenance": {
                    "source": "npm",
                    "source_url": "https://www.npmjs.com/package/axios",
                    "version": "1.7.9"
                  },
                  "truncated": false
                }
              ],
              "topic": "request"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "method": {
                  "enum": [
                    "GET",
                    "HEAD",
                    "DELETE"
                  ],
                  "type": "string"
                },
                "queryParams": {
                  "properties": {
                    "ecosystem": {
                      "description": "Package ecosystem. Aliases accepted: pip and python map to pypi; cargo and rust map to crates; node maps to npm; gh maps to github.",
                      "enum": [
                        "npm",
                        "pypi",
                        "crates",
                        "github"
                      ],
                      "type": "string"
                    },
                    "name": {
                      "description": "Package name; for github pass owner/repo such as coinbase/x402. npm scoped names @scope/name are allowed.",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Optional symbol name to match, an alias for topic.",
                      "type": "string"
                    },
                    "topic": {
                      "description": "Optional topic or symbol; matched against the README/llms.txt markdown headings, such as authentication or useEffect.",
                      "type": "string"
                    },
                    "version": {
                      "description": "Optional exact version to pin, such as 2.31.0; default is latest.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "ecosystem"
                  ],
                  "type": "object"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "api.agentstools.dev",
    "manifest_name": "api.agentstools.dev",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "attribution": [
      "npm public registry (registry.npmjs.org)."
    ],
    "capped": true,
    "count": 2,
    "found": true,
    "identity": {
      "ecosystem": "npm",
      "name": "axios",
      "resolved_version": "1.7.9"
    },
    "snippets": [
      {
        "code": "const res = await axios.get('/user?ID=12345')",
        "heading": "Example",
        "language": "js",
        "provenance": {
          "source": "npm",
          "source_url": "https://www.npmjs.com/package/axios",
          "version": "1.7.9"
        },
        "truncated": false
      }
    ],
    "topic": "request"
  }
}