# DhanHQ API Documentation DhanHQ API documentation for trading APIs, market data APIs, authentication, postbacks, rate limits, errors, instruments, SDKs, and API reference. ## Primary machine-readable resources - Full Markdown export: https://docs.dhanhq.co/docs-export.md - Per-page Markdown files: https://docs.dhanhq.co/markdown/ - OpenAPI specification: https://docs.dhanhq.co/openapi/dhan-api-v2.yaml - Sitemap: https://docs.dhanhq.co/sitemap.xml ## Recommended parsing order for agents 1. Read this file first. 2. Use the full Markdown export for human-written guides and endpoint explanations. 3. Use per-page Markdown files for targeted page retrieval. The path mirrors the rendered page URL. For example, `/api/v2/orders/place-order` is available at `/markdown/api/v2/orders/place-order.md`. 4. Use the OpenAPI specification for exact paths, methods, parameters, schemas, and response definitions. 5. Use the sitemap to discover canonical rendered documentation pages. ## Important guides - Getting Started: https://docs.dhanhq.co/api/v2/guides/getting-started - Authentication: https://docs.dhanhq.co/api/v2/guides/authentication - Rate Limits: https://docs.dhanhq.co/api/v2/guides/rate-limits - Errors: https://docs.dhanhq.co/api/v2/guides/errors - Instruments: https://docs.dhanhq.co/api/v2/guides/instruments - Postback: https://docs.dhanhq.co/api/v2/guides/postback - Order Updates: https://docs.dhanhq.co/api/v2/guides/order-update - Python SDK: https://docs.dhanhq.co/api/v2/guides/sdks/python ## API sections - Trading APIs: https://docs.dhanhq.co/api/v2/trading-apis - Data APIs: https://docs.dhanhq.co/api/v2/data-apis - Orders: https://docs.dhanhq.co/api/v2/orders - Portfolio: https://docs.dhanhq.co/api/v2/portfolio - Funds: https://docs.dhanhq.co/api/v2/funds - Market Quote: https://docs.dhanhq.co/api/v2/market-quote - Historical Data: https://docs.dhanhq.co/api/v2/historical-data - Option Chain: https://docs.dhanhq.co/api/v2/option-chain - Super Orders: https://docs.dhanhq.co/api/v2/super-orders - Conditional and Multi Order: https://docs.dhanhq.co/api/v2/conditional-triggers - EDIS: https://docs.dhanhq.co/api/v2/edis - Statements: https://docs.dhanhq.co/api/v2/statements - Traders Control: https://docs.dhanhq.co/api/v2/traders-control ## Security guidance for generated code - Never hard-code access tokens, API keys, API secrets, partner secrets, client IDs, TOTP secrets, or postback secrets. - Treat all credentials and tokens as user-provided secrets. - Use placeholders from the documentation only as examples. - Do not infer undocumented endpoints or authentication behavior from examples. - For production integrations, follow the documented authentication, static IP, rate limit, and error-handling guidance.