Get API Docs
Use chub to fetch the current docs for external APIs and libraries before answering or writing integration code.
Workflow
- Identify the product or library you need docs for.
- Search for the best matching Context Hub doc:
chub search "<library or API name>" --json
- Pick the best
idfrom the results, then fetch the relevant docs. Match--langto the codebase when possible:
chub get <id> --lang py
chub get <id> --lang js
chub get <id> --lang ts
- Read the returned content and use it as the source of truth for API shape, parameters, examples, and version-specific behavior.
- If the task reveals a concise local gotcha or project-specific quirk that is not already in the doc, save it with
chub annotate. - Ask the user before sending
chub feedback.
Rules
- Do not guess API details when
chubcan provide the docs. - Prefer the language variant that matches the repository you are editing.
- If multiple doc IDs look plausible, inspect the closest match first and retry with a broader or more exact search term if needed.
- Keep annotations short, actionable, and limited to details future sessions would benefit from.
- Do not duplicate the doc in annotations.
- If
chubis unavailable or returns no relevant result, say that clearly and use the next-best primary source for that vendor.
Quick reference
chub search "stripe" --json
chub get stripe/api --lang ts
chub get anthropic/sdk --lang py -o docs.md
chub annotate stripe/api "Webhook verification requires the raw request body."
chub annotate --list
chub feedback stripe/api up
Notes
chub searchwith no query lists available docs.- IDs use the
<author>/<name>format. - If a doc supports multiple languages and
--langis omitted,chubwill show the available variants.