{"repo":"diffbot/diffbot-python","free":true,"listed":false,"github":"https://github.com/diffbot/diffbot-python","clone":"git clone https://github.com/diffbot/diffbot-python.git","description":"Python client library for Diffbot APIs","language":"Python","stars":124,"topics":["crawler","knowledge-graph","natural-language-processing","web-data","web-data-extraction"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"Diffbot Python Library Python client library for Diffbot APIs. Installation Install the standalone CLI binary for agentic use: If you prefer, the full Python library can also be installed with pip: For local development: Usage Authentication The CLI and the library can share a single credential. The token always has to be passed to the client explicitly, but resolve token() gives you the same lookup the CLI uses, in this order: 1. An explicit token passed to resolve token(token) . 2. The DIFFBOT API TOKEN environment variable. 3. A DIFFBOT API TOKEN=... line in /.diffbot/credentials . Set it once and it works for both the CLI and your scripts. Either export it: …or write it to the shared credentials file (handy for keeping it out of your shell environment): With either in place, resolve the token and pass it to the client: Extract structured content Ask Diffbot LLM Structured output Pass a JSON Schema to constrain the answer. The model is held to the schema by a grammar during decoding, so the result parses reliably even though the answer is retrieved live from the web. Omit the schema to let the model choose the shape, or use ask with response format to stream a constrained answer: Avoid response format={\"type\": \"json object\"} . The endpoint accepts it, but applies no grammar to it — the RAG loop's internal tool call is itself a JSON object, so it can be returned as the final answer. This is reproducible whenever the request includes a system message. ask json therefore defa","default_branch":null,"files":null,"tree":[],"storefront":"/r/diffbot","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/diffbot/diffbot-python/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}