Introducing: All-new way to interact with DhanHQ APIs Documents - Now Read, Interact and Test on the go!

Hello API Developers & Traders,

In the Indian broking industry, APIs have always been an afterthought. Every trading platform optimised for their frontend experience, and their backend infrastructure somewhere was prioritised far down the list. APIs are something which were launched as an add-on, often repackaging internal middleware APIs to direct API access. Very few platforms have ever truly asked what it means to build an API stack with developers at the center.

From day one, DhanHQ Trading & Data APIs was our answer to that question. We wanted to build something simplified, well-structured, and genuinely thoughtful for developers who are building algorithmic trading systems, investment platforms, research tools, or anything in between. Whether you are a seasoned quant who has worked with a dozen broker APIs, or someone writing their first automated trading script, DhanHQ was built to meet you where you are. That has always been something we have taken real pride in, and it continues to shape every decision we make around our API stack.

But building great APIs is only half the story. The other half is how developers discover, understand, and work with those APIs over time. Because for any API, documentation is the interface. It is the very first thing you encounter when you decide to build on a platform. It is the place you return to at midnight when something is not behaving as expected. It is the foundation on which every integration, every strategy, and every product built on top of DhanHQ begins.

Since most of us have a tech mind driven mindset, we have always kept our documentation thorough, structured, and up to date. But we also knew we wanted to keep raising the bar, because the way developers work, and the tools they use, keeps evolving.

There is one shift in particular that we have been watching closely. A few years ago, it was safe to assume that the primary reader of API documentation was a human developer, someone who would read through an endpoint, understand it, and then go write the code. That assumption no longer holds.

Today, more AI agents and coding tools access API documentation than human developers do globally. Developers are increasingly working alongside AI assistants, using agents to scaffold integrations, and feeding documentation directly into tools that help them build faster. Documentation is no longer just for humans. It needs to work just as well for the machines that developers rely on.

We wanted to build something that was ready for all of this. A single place where everything a developer needs, from discovery to testing to building, comes together without friction.

Today, we are introducing the new DhanHQ v2 API Documentation, a unified experience built from the ground up for how developers actually work today. And more importantly, these APIs and documentation are also built for developers of tomorrow, who will code with AI or AI-driven agents.

If you are a trader, an investor, or someone who is simply curious about what you can build with DhanHQ Trading & Data APIs, think of this portal as a single destination where every capability we offer is documented, explained, and ready to try.

In the past, testing whether something worked the way you expected it to require setting up a UAT or development environment, writing code, and going through several steps before you could see a result. What we have built removes all of that. You can now read about a feature, fill in a few fields, and see exactly what happens, live, right there on the page. No code required to get started. That accessibility matters to us, because the line between a curious trader and someone who wants to build something on top of DhanHQ is thinner than most people think.

For developers, here is what this means in practice. Every endpoint in the new documentation comes with a fully interactive, form-based input panel. You fill in your parameters, choose whether you want to test against the Live URL or the Sandbox environment, and fire the request directly from the documentation page. The response comes back right there. The entire loop of reading about an endpoint, understanding what it expects, testing it, and iterating on it now happens in one place, without switching tabs, without copying endpoints into Postman, without any of the friction that has always existed between documentation and actual testing.

The Sandbox and Live environments are both accessible from the same interface. This matters more than it might seem at first. When you are building and testing, you want to be in the Sandbox. When you are ready to validate against real market behaviour, you switch to Live. Having both available in the same place, with the same interface, means you can move between them fluidly as your development progresses.

We have also made the documentation AI-ready from day one, because that is simply where the industry is heading. You can export the entire DhanHQ documentation as Markdown in a single click, or export any individual endpoint on its own. Take that Markdown and hand it directly to your AI assistant, drop it into your coding agent’s context, or use it however your workflow demands. When your tools understand your API layer as well as you do, building gets meaningfully faster. We wanted to make sure DhanHQ documentation works as well for the agent in your workflow as it does for you.

Built-in code samples round out the experience. Every endpoint comes with ready-to-use snippets across cURL, Python, C#, Golang, Dart, and more, so the distance between understanding an API and writing your first call to it is as short as we can make it. Less time on boilerplate, more time on what you are actually trying to build.

Developer experience is something we hold to a very high standard at Dhan, and we have never been willing to treat it as secondary. The new DhanHQ v2 documentation is a foundation, and it is also a statement of intent. There is significantly more we are building out as part of this developer toolkit, and this is only the beginning.

Stay tuned, because we are just getting started.

Explore the new docs at docs.dhanhq.co/ and let us know what you think.
We would love to hear your feedback.

Happy Building!
Kushagra Rohatgi

6 Likes

@Kushagra_Rohatgi This looks good as the api samples have more programming language options. For Skills, are models from ollama supported too?

1 Like

Yes, should work if your Ollama setup is running through an agent that supports SKILL.md.
The skill is model-agnostic, so it isn’t tied to Claude or Codex specifically and Ollama should work too if it’s being used through an agent wrapper that can read and use SKILL.md.

@Kushagra_Rohatgi I understand. My point is has Dhan tested it with models from ollama? If yes, can you add the steps in the README?

The skills.md format is based on the open Agent Skills standard from agentskills.io, so you can refer to that for the underlying structure.

Ollama itself does not natively support Skills as a standalone feature, but since Skills are an open format, they can still work through compatible agent layers or IDEs. For example, OpenCode supports Agent Skills and can also run with local Ollama models, so Ollama + OpenCode can make this workflow possible.

In the documentation, we have only mentioned the most popular and widely used tools like Claude Code, Codex, Cursor, etc. The skill itself is not limited to only those tools.

can you tell about mcp and backtesting

@Kushagra_Rohatgi I very well know what skills.md is for and I never expected a chatgpt formatted response. My only ask is if you can test out the setup with ollama and accordingly update the documentation. I am an engineer myself and I am well aware of the terms.