FREE DEVELOPER TOOL

cURL to PHP converter

Turn your cURL command into PHP code. Paste, convert, and get back to building.

No signup required
Runs in your browser
Your requests stay private

Your cURL command

Try an example

<?php

$ch = curl_init("https://example.com/products?page=1");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Accept: text/html"],
    CURLOPT_HTTPHEADER => ["User-Agent: MyApp/1.0"],
]);

$response = curl_exec($ch);
curl_close($ch);
echo $response;

No requests are sent to the target website ·⌘ / CtrlEnterto convert

TAKE THE NEXT STEP

Code converted.
Build with Scrapeless.

Get web content with one API call. Let Scrapeless take care of CAPTCHA solving, IP rotation and JavaScript rendering.

CAPTCHA solving
IP rotation
JavaScript rendering

Python example from the docs. Add your API key and set your target URL.

import requests
import json

API_KEY = ""
host = "api.scrapeless.com"
url = f"https://{host}/api/v2/unlocker/request"

payload = json.dumps({
    "actor": "unlocker.webunlocker",
    "input": {
        "url": "https://httpbin.io/get",
        "redirect": False,
        "method": "GET"
    },
    "proxy": {"country": "ANY"}
})
headers = {
    "Content-Type": "application/json",
    "x-api-token": f'{API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Python · Web Unlocker

LESS TRANSLATING. MORE BUILDING.

One request. Three simple steps.

Move from your terminal or browser DevTools to the language you actually work in.

01

Copy your cURL command

Use a terminal command, or select “Copy as cURL (bash)” from your browser’s Network tab.

02

Choose your language

Convert to Python, Node.js, Go and more. Review the method, headers, cookies and body in the result.

03

Copy the code. Make it yours.

Install the indicated library and run it in your project. Explore the Scrapeless documentation when you are ready to scale.

YOUR REQUEST YOUR STACK

Speak your language

29 programming languages. Plus Axios and Fetch for Node.js.

MATLAB

cURL to MATLAB

webwrite

More Language coming soon.

Can’t find your language? —
Let us know

GOOD TO KNOW

A few answers. Then back to code.

Questions about conversion, privacy, or running your request?

Explore documentation

Is this cURL converter free?

Yes. Convert, copy and download code without creating an account. The optional Scrapeless Web Unlocker service requires an account and is billed separately.

Does my cURL command leave my browser?

No. Parsing and code generation happen in this page. Your command is not uploaded, executed or saved to browser storage. Copying or downloading code is your choice.

Which cURL options can I convert?

Common HTTP requests with a URL, method, headers, cookies, basic authentication and inline request bodies are supported. File uploads, shell variables and advanced transport flags need manual review; unsupported options are reported instead of silently discarded.

Why does my converted request return 403?

The website may reject the request because of expired cookies, missing authentication or request limits. Converting syntax does not reproduce a browser session. Check the response and your access permissions; Web Unlocker provides managed web-content retrieval.

Does the converter send my request?

No. It generates code locally without contacting the target website. Run and test the output in your own development environment.

How do I start using Scrapeless?

Choose Web Unlocker or Proxies in the section above to view a Python example from our documentation. Create an account, add your credentials and follow the linked guide. These examples are independent of your converted request.

From your first request to your next million

Built Something? Keep It Running.