• Pricing
  • Blog
Sign InGet Started
Free Tool

cURL → Code (2026)

Convert any curl command into JavaScript fetch, Node fetch, Axios, Python requests, or Go net/http. Paste, pick a language, copy. Pure browser, no upload.

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();

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.

For full code samples in 30+ languages

Specway's docs platform auto-generates code samples in JavaScript, TypeScript, Python, Ruby, PHP, Go, Rust, Java, Kotlin, Swift, C#, and more — for every operation in your OpenAPI spec, kept in sync with every API change. This tool is the quick one-off; Specway is the system.

Ship API docs that stay this clean

Specway turns your OpenAPI spec into a branded developer portal — auto-synced, searchable, with built-in playground and code samples in every language. Free tier available.

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

Beautiful API documentation that developers love.

Features

  • AI-Generated Docs
  • Interactive Playground
  • Auto-Sync
  • AI Chatbot
  • Breaking Changes
  • Code Samples
  • Custom Branding
  • Analytics

Compare

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

Ecosystem

  • Workflows
  • Forms
  • Marketplace
  • Integrations
  • MCP Servers
  • Digital Rooms
  • Product OS

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
  • Pricing
  • Blog
Sign InGet Started
Free Tool

cURL → Code (2026)

Convert any curl command into JavaScript fetch, Node fetch, Axios, Python requests, or Go net/http. Paste, pick a language, copy. Pure browser, no upload.

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();

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.

For full code samples in 30+ languages

Specway's docs platform auto-generates code samples in JavaScript, TypeScript, Python, Ruby, PHP, Go, Rust, Java, Kotlin, Swift, C#, and more — for every operation in your OpenAPI spec, kept in sync with every API change. This tool is the quick one-off; Specway is the system.

Ship API docs that stay this clean

Specway turns your OpenAPI spec into a branded developer portal — auto-synced, searchable, with built-in playground and code samples in every language. Free tier available.

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

Beautiful API documentation that developers love.

Features

  • AI-Generated Docs
  • Interactive Playground
  • Auto-Sync
  • AI Chatbot
  • Breaking Changes
  • Code Samples
  • Custom Branding
  • Analytics

Compare

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

Ecosystem

  • Workflows
  • Forms
  • Marketplace
  • Integrations
  • MCP Servers
  • Digital Rooms
  • Product OS

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