Scraping API Prices
MenuClose

Search the site

91 providers, their alternatives and head-to-heads, targets, guides and answers

Home / Cost tools / cURL converter / MATLAB

cURL to MATLAB converter

Paste a cURL command and get the same request in MATLAB, using matlab.net.http. It converts in your browser; nothing you paste is sent anywhere.

Converted in your browser. Nothing you paste is stored or sent, so a command with your API key in it stays on your machine.

MATLAB, with matlab.net.http
import matlab.net.*
import matlab.net.http.*

header = [ ...
    HeaderField('Authorization', 'Bearer YOUR_API_KEY')];
body = [];
request = RequestMessage('get', header, body);
options = HTTPOptions();
options.MaxRedirects = 0;
response = request.send(URI('https://api.scraper.example/v1/scrape?url=https%3A%2F%2Fshop.example.com%2Fproducts%3Fpage%3D2&render_js=true&country=us'), options);
disp(response.StatusCode)
disp(response.Body.Data)

Running the code

It uses the matlab.net.http classes that ship with MATLAB. Run it as a script; the header fields and body become a RequestMessage sent to the URI.

Where matlab.net.http differs from curl

A JSON reply is decoded into a MATLAB struct in response.Body.Data, and the status code is an enumeration that displays as its name, such as OK.

What calls like this one cost

The example is a scraping API call with JavaScript rendering on and a country chosen. 100,000 of them a month cost from $49.00 on ScrapeBadger, and the same pages without rendering from $14.99 on FlyByAPIs AI Web Scraper, the cheapest complete bills across 32 web scraping APIs this site prices from their own pages. What rendering adds on each API

The same command in another language