Getting Started

Setting up the Universal Scraper API


LunaProxy’s Universal Scraper API makes it quick, efficient, and easy to extract data from web pages. Whether you’re new or already experienced, LunaProxy can meet your needs and allow you to easily collect data from the web while overcoming common challenges brought by modern websites, including CAPTCHA and anti-bot mechanisms.

Getting Started


1.After logging in,click on the sidebar Universal Scraper API to enter the Request Configuration page.

2.Configure request parameters

LunaProxy’s API provides a simple way to scrape the web with only two key parameters:

  • API Token – a unique key used to authenticate requests.

  • URL – the target URL you want to scrape.

Be sure to double-check that the URL you want to scrape is correct to avoid issues with special characters such as spaces, question marks, and & symbols. This will avoid common problems such as request interruptions or incorrect data parsing.

You can do the following:

  1. Select the API Token you want to use (to create a new token, click to jump to the sub-account page)

  2. Paste the target URL into the input box.

  3. Select the rendering method html or png.

  4. Enable other parameters such as: js rendering, blocking loading, country/region

  5. Select the programming language. For general use, please select "cURL" to generate a complete API endpoint that works with any HTTP client.

  6. Copy the generated code and integrate it into your own script.

Send the First Request


Take data crawling from https://www.google.com/ as an example. Please don’t forget to replace “token” with your API Token.

curl --request POST --url 
https://unlocker-api.lunaproxy.com/request
 --header "Authorization: Bearer token" --header "content-type: application/json" --data "{\"url\":\"
https://www.google.com/\",\"type\":\"html\",\"js_render\":\"False\"}"
 > google.html

Parameter Overview


Customize your scraping requests using the following parameters:

PARAMETER
TYPE
DEFAULT
DESCRIPTION

token required

string

Get Your Free API Token(Click to jump to the create api token page)

Your unique API key for authentication.

url required

string

The URL of the page you want to scrape.

js_render

boolean

false

Enable JavaScript rendering with a headless browser. Essential for modern web apps, SPAs, and sites with dynamic content.

proxy

string

Set the country of the IP used for the request (requires Premium Proxies).

block

string

Block specific resources (images, fonts, etc.) from loading to speed up scraping and reduce bandwidth usage.

type

string

The rendering type is html or png, the default is html.

Last updated

Was this helpful?