Developer Tools
API Request Generator
Describe an HTTP request once and get working code in five languages. Ideal for testing REST APIs, writing documentation and sharing reproducible examples with your team.
Build a Request
Fill in the request details. Code for every language updates as you type.
How to Use the API Request Generator
- Choose the HTTP method and enter the full URL, including any query string.
- Add headers one per line, such as
Content-Type,Authorizationor an API key header. - Add a JSON or text body for POST, PUT and PATCH requests.
- Pick a language tab and copy the generated code.
Which Format Should I Use?
| Format | Best for |
|---|---|
| cURL | Quick tests in a terminal, API documentation, sharing with support teams and importing into Postman or Insomnia |
| fetch | Browsers and modern Node.js, with no extra library |
| Axios | React, Vue and Node.js projects that already use Axios |
| Python requests | Scripts, data work, automation and Django or Flask back ends |
| PHP cURL | WordPress plugins, Laravel and other PHP projects |
HTTP Methods at a Glance
- GET reads data and has no body.
- POST creates a new resource or triggers an action.
- PUT replaces a resource, while PATCH updates only some fields.
- DELETE removes a resource.
Keep Your Keys Safe
Replace real tokens with placeholders such as YOUR_TOKEN before sharing code or putting it in documentation. Never put secret API keys in front-end JavaScript that runs in visitors' browsers; call the API from your server instead. This generator works entirely in your browser and does not send any request or store your headers.
Frequently Asked Questions
Does this tool send the API request?
No. It only generates code. Run the code in your terminal, browser console or application to make the request.
How do I convert a cURL command to Python?
Enter the same method, URL, headers and body here, then choose the Python tab to get equivalent requests code.
Why is my JSON body sent as text?
If the body is not valid JSON, it is sent as a plain string. Fix the JSON and it will be generated as a proper object.
Are my API keys stored?
No. Nothing you enter leaves your browser.