Convert cURL to JavaScript, Python or Go (2026)
Convert curl to JavaScript (fetch or Axios), Python requests, Node.js, or Go net/http. Paste the curl command, pick a language, copy the code. Runs in your browser, nothing is uploaded.
const res = await fetch('https://api.specway.com/v1/specs', {
method: 'POST',
headers: {
"Authorization": "Bearer sk_test_123",
"Content-Type": "application/json"
},
body: "{\"name\":\"Pet Store\",\"openapiUrl\":\"https://example.com/openapi.yaml\"}",
});
const data = await res.json();Writing curl examples by hand?
Specway generates code samples in cURL, Node, Python, Ruby and PHP for every endpoint in your OpenAPI spec, built from the current schema.
Free plan: 1 API, 1,000 views a month, no credit card, no time limit.
- Code samples in cURL, Node, Python, Ruby and PHP for every endpoint
- Interactive reference docs generated from your OpenAPI spec
- One-click re-sync from your spec URL, with a list of what changed
When you reach for this
A teammate sends you a curl in Slack: "hit this endpoint and you'll see the bug." You need that same call in your test suite, your script, your documentation. Paste, pick the language, copy.
Or: API docs only have curl examples and you want something more idiomatic for your codebase. Same workflow.
What gets converted
- URL — the first non-flag positional argument.
- Method — from
-X/--request, defaults to GET (or POST if a body is present). - Headers — every
-H/--headerbecomes a key/value entry. - Body —
-d,--data,--data-raw, and--data-binaryall work. JSON is preserved as-is. - Basic auth —
-u user:passconverts to a base64 Authorization header.
Edge cases the converter punts on
- --form / multipart: language idioms differ (FormData vs files= vs multipart.NewWriter) — convert manually.
- --cookie / cookie jars: state management differs across libraries.
- --cert / --insecure: TLS handling belongs to your HTTP client config, not the request itself.
- --output / file streaming: response streaming is library-specific.
Code samples for every endpoint
Specway's docs platform generates code samples in cURL, Node, Python, Ruby and PHP for every operation in your OpenAPI spec, built from the current schema. This tool is the quick one-off for a single request.
Frequently asked questions
Ship API docs that stay this clean
Specway turns one OpenAPI spec into a hosted developer portal with llms.txt and an mcp.json tool manifest. When the spec changes, re-sync in one click.
Free plan: 1 API, 1,000 views a month, no credit card, no time limit.