ZapKit

API request code generator

Describe a request once, with method, URL, headers, query and body, and get correct, ready-to-paste code for six common clients.

What is an API request code generator?

An API request code generator writes the code to call an HTTP API from a simple description of the request. It saves looking up each library's syntax and avoids quoting mistakes, which is handy when documenting an API, sharing a reproducible example or moving a call between languages.

Choose the method, enter the URL, and add query parameters and headers as name and value pairs. For methods that carry a body, pick JSON, form fields or text. Code appears for cURL, JavaScript fetch, Axios, Python requests, HTTPie and PowerShell, and updates as you edit.

How to use the API request code generator

  1. 1.Fill in the request

    Method, URL, query parameters and headers.

  2. 2.Add a body

    JSON, form fields or raw text for POST, PUT and PATCH.

  3. 3.Pick a language and copy

    Switching languages keeps the same request.

Example: creating an order

POST https://api.example.com/v1/orders?notify=true with a bearer token and a JSON body:

cURL
curl -X POST '…/orders?notify=true' -H 'Authorization: Bearer …' --data-raw '{…}'
Python
requests.post(url, headers={…}, json={"sku": "LMP-01", "qty": 2}, timeout=30)
Content-Type
added automatically as application/json

One request, correct in six languages.

Quoting done right

Generated code handles the fiddly parts: shell quoting of apostrophes for cURL and HTTPie, URL-encoding query parameters, JSON bodies rendered as native objects in fetch, Axios and Python, Python's True, False and None, and the right Content-Type header added automatically.

Form bodies are typed as name=value lines and sent URL-encoded. To turn an existing cURL command into code instead, use the cURL converter. To actually send the request and see the response, use the API tester.

Frequently asked questions

Does it send the request?

No. It only writes code. The API tester sends requests.

Is it safe to type my API key?

It stays in this page, but generated code contains it, so don't share or commit that code.

Why does Python use json= instead of a header?

requests sets Content-Type: application/json itself when you pass json=.

Can I add file uploads?

Not yet. Multipart uploads need a file, so write those by hand.

More Developer tools