• Pricing
  • Blog
Sign InGet Started

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.

Generate samples for every endpointSee pricing

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 / --header becomes a key/value entry.
  • Body — -d, --data, --data-raw, and --data-binary all work. JSON is preserved as-is.
  • Basic auth — -u user:pass converts 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.

Related tools

JSON Formatter
Clean up the request body before pasting.
JWT Decoder
Decode the Authorization header.
OpenAPI → Postman
Get a full collection of curl-equivalent requests.
OpenAPI Viewer
Browse all the operations in a spec.

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.

Try Specway free

Free plan: 1 API, 1,000 views a month, no credit card, no time limit.

API docs that developers and AI agents can use.

Features

  • AI-Generated Docs
  • Interactive Playground
  • Spec URL Sync
  • AI Chatbot
  • Spec Changes
  • Code Samples
  • Custom Branding
  • Analytics

Compare

  • vs ReadMe
  • vs Swagger UI
  • vs Mintlify
  • vs Postman
  • vs Scalar

Product

  • Pricing
  • API Directory
  • Live Demo
  • About
  • Contact

Free Tools

  • JSON Formatter
  • JSON Validator
  • JWT Decoder
  • OpenAPI Validator
  • cURL → Code
  • YAML ↔ JSON
  • All free tools →

Resources

  • Free Developer Tools
  • Blog
  • Guides
  • API Glossary
  • Help Center
  • Support

© 2026 Modlific. All rights reserved.

Privacy PolicyTerms of Service