Realm by Rook
AI product engineeringProduct designAI implementationWorkflow automationSystems integrationDomain strategyAI product engineeringProduct designAI implementationWorkflow automationSystems integrationDomain strategy
Developer & Technical Tools

curl Converter

Convert curl commands to fetch, axios, Python requests, Go net/http, or Node.js

const response = await fetch("https://api.example.com/v1/users", {
  "method": "POST",
  "headers": {
    "Authorization": "Bearer sk_live_abc123",
    "Content-Type": "application/json"
  },
  "body": "{\"email\":\"ada@example.com\",\"role\":\"admin\"}"
});
const data = await response.json();

How to use

  1. Paste a curl command
  2. Pick target language
  3. Copy the generated code

Use cases

  • API prototyping
  • DevTools → code
  • Multi-language SDKs

About the curl → fetch / axios / Python / Go / Node

curl commands are the lingua franca of API documentation, but you almost never deploy a shell script — you deploy code. This tool converts any curl command to idiomatic code in 5 popular languages/libraries, so you can skip the transcription step when moving from 'works in my terminal' to 'works in my app.'

Features

  • 5 target languages / libraries
  • Handles -X -H -d --data --data-raw --data-binary -F --form -u
  • Auto-sets POST when -d is present
  • Preserves headers, basic auth, form data
  • Shell-safe tokenizer — handles line-continuation backslashes and nested quotes

How it works

  1. Paste a curl command (copy from Chrome DevTools, Postman, etc.).
  2. Pick the target language.
  3. Copy the generated code.

Frequently asked questions

Where do I paste curl commands from?

+

Chrome DevTools → Network tab → right-click a request → Copy → Copy as cURL. Same works in Firefox, Safari, and Postman.

Does it handle multipart uploads?

+

Yes — -F / --form arguments are converted to FormData (fetch) or files= (Python). Binary file uploads are declared; you still need to populate file contents in your code.

Which Python library?

+

requests, because it's the de-facto standard. We can add httpx and aiohttp if asked.

Why does my output look wrong?

+

Most commonly: the curl command has unusual flags we don't handle (most HTTP bodies, auth, and headers are covered; TLS client certs and HTTP/2 settings are not). File an issue with the exact command.

Is my request sent anywhere?

+

No. Parsing and conversion are purely client-side.