Shopee API
Overview
Here is the list of the different parameters you can use with ScrapingBee's Shopee API.
You can also discover this API using our Postman collection covering every ScrapingBee's features.
Our Shopee API lets you scrape a Shopee product page and receive structured product data (title, price, rating, images, variants, and more) in a single request.
We provide one endpoint:
- Shopee endpoint (
/api/v1/shopee) - Scrape a Shopee product page and receive structured product data
Only Shopee Indonesia (shopee.co.id) product URLs are supported at the moment. A request with any other host returns a 400 response.
Quick start
To use the Shopee API, you only need two things:
- your API key, available here
- a
shopee.co.idproduct URL to scrape (learn more about the URL parameter)
Then, simply do this.
curl "https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105" \
-H "Authorization: Bearer YOUR-API-KEY"
# Install the Python Requests library:
# pip install requests
import requests
def send_request():
response = requests.get(
url='https://app.scrapingbee.com/api/v1/shopee',
headers={
'Authorization': 'Bearer YOUR-API-KEY',
},
params={
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
},
)
print('Response HTTP Status Code: ', response.status_code)
print('Response HTTP Response Body: ', response.content)
send_request()
// Install the Node Axios package
// npm install axios
const axios = require('axios');
axios.get('https://app.scrapingbee.com/api/v1/shopee', {
headers: {
'Authorization': 'Bearer YOUR-API-KEY',
},
params: {
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
}
}).then(function (response) {
// handle success
console.log(response);
})
import java.io.IOException;
import org.apache.http.client.fluent.*;
public class SendRequest
{
public static void main(String[] args) {
sendRequest();
}
private static void sendRequest() {
// Classic (GET )
try {
// Create request
Content content = Request.Get("https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105")
// Authenticate with your API key
.addHeader("Authorization", "Bearer YOUR-API-KEY")
// Fetch request and return content
.execute().returnContent();
// Print content
System.out.println(content);
}
catch (IOException e) { System.out.println(e); }
}
}
require 'net/http'
require 'net/https'
# Classic (GET )
def send_request
uri = URI('https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105')
# Create client
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
# Create Request
req = Net::HTTP::Get.new(uri)
# Authenticate with your API key
req['Authorization'] = 'Bearer YOUR-API-KEY'
# Fetch Request
res = http.request(req)
puts "Response HTTP Status Code: #{ res.code }"
puts "Response HTTP Response Body: #{ res.body }"
rescue StandardError => e
puts "HTTP Request failed (#{ e.message })"
end
send_request()
<?php
// get cURL resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, 'https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105');
// authenticate with your API key
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR-API-KEY',
]);
// set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
// return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// send the request and save response to $response
$response = curl_exec($ch);
// stop if fails
if (!$response) {
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;
echo 'Response Body: ' . $response . PHP_EOL;
// close curl resource to free up system resources
curl_close($ch);
>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func sendClassic() {
// Create client
client := &http.Client{}
// Create request
req, err := http.NewRequest("GET", "https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105", nil)
// Authenticate with your API key
req.Header.Set("Authorization", "Bearer YOUR-API-KEY")
parseFormErr := req.ParseForm()
if parseFormErr != nil {
fmt.Println(parseFormErr)
}
// Fetch Request
resp, err := client.Do(req)
if err != nil {
fmt.Println("Failure : ", err)
}
// Read Response Body
respBody, _ := ioutil.ReadAll(resp.Body)
// Display Results
fmt.Println("response Status : ", resp.Status)
fmt.Println("response Headers : ", resp.Header)
fmt.Println("response Body : ", string(respBody))
}
func main() {
sendClassic()
}
# This API is not available in the CLI.
Here is a breakdown of all the parameters you can use with the Shopee API:
type]
(default)string]
("")Response Example
The API will then respond with formatted JSON data:
{
"title": "Tinta Epson 664 / T664 Original (L120 L121 L1300)",
"price": 102000.0,
"item_id": 1881883105,
"shop_id": 93014939,
"currency": "IDR",
"stock": 40,
"rating": 4.96,
"reviews_count": 9014,
"url": "https://shopee.co.id/product-name-i.93014939.1881883105",
# Original price before discount, when applicable
"original_price": null,
"images": [
"https://down-id.img.susercontent.com/file/5668e3a147faedccb38836a5e1984acc",
"https://down-id.img.susercontent.com/file/id-11134201-7qukw-ler0h6bvxhf6f7"
],
"description": "HARGA UNTUK 1 BOTOL, BUKAN 1 SET ...",
"seller_name": "Kreasindo Retail Official Store",
"variants": [
{"model_id": 3236230061, "name": "Black (T6641)", "stock": 10, "price": null},
{"model_id": 3236230062, "name": "Cyan (T6642)", "stock": 10, "price": null}
],
"category": ["Computer & Accessories", "Printers & Scanners", "Inks & Toners"],
"sold_count": null,
# Full HTML of the page, included only if add_html=true
"html": null
}
Some fields may be null when Shopee does not expose them for a given product.
Keep in mind that each successful API call will cost you 75 api credits. Failed requests are not charged.
Every request that fails is retried automatically, so a request may take longer to return. Please be aware of this when writing your own code.
API key
All requests are authenticated by using your private API key.
To get access to your API key, just create an account here and confirm your email.
URL
The url parameter is the Shopee product page you want to scrape. This is required.
The URL must be a valid Shopee Indonesia product URL — its host must be shopee.co.id. Shopee product URLs end with the ...-i.<shop_id>.<item_id> pattern, from which the shop_id and item_id are read.
Shopee product URLs often carry a query string such as ?extraParams=.... Pass the entire URL — query string included — as the url parameter; it is supported and forwarded as-is. For example:
https://shopee.co.id/ALOY-RETAIL-PL-AR004-...-i.387295480.20575538643?extraParams=%7B%22display_model_id%22%3A165684988783%2C%22model_selection_logic%22%3A2%7D
Any request whose URL host is not shopee.co.id returns a 400 response.
curl "https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105" \
-H "Authorization: Bearer YOUR-API-KEY"
# Install the Python Requests library:
# pip install requests
import requests
def send_request():
response = requests.get(
url='https://app.scrapingbee.com/api/v1/shopee',
headers={
'Authorization': 'Bearer YOUR-API-KEY',
},
params={
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
},
)
print('Response HTTP Status Code: ', response.status_code)
print('Response HTTP Response Body: ', response.content)
send_request()
// Install the Node Axios package
// npm install axios
const axios = require('axios');
axios.get('https://app.scrapingbee.com/api/v1/shopee', {
headers: {
'Authorization': 'Bearer YOUR-API-KEY',
},
params: {
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
}
}).then(function (response) {
// handle success
console.log(response);
})
import java.io.IOException;
import org.apache.http.client.fluent.*;
public class SendRequest
{
public static void main(String[] args) {
sendRequest();
}
private static void sendRequest() {
// Classic (GET )
try {
// Create request
Content content = Request.Get("https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105")
// Authenticate with your API key
.addHeader("Authorization", "Bearer YOUR-API-KEY")
// Fetch request and return content
.execute().returnContent();
// Print content
System.out.println(content);
}
catch (IOException e) { System.out.println(e); }
}
}
require 'net/http'
require 'net/https'
# Classic (GET )
def send_request
uri = URI('https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105')
# Create client
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
# Create Request
req = Net::HTTP::Get.new(uri)
# Authenticate with your API key
req['Authorization'] = 'Bearer YOUR-API-KEY'
# Fetch Request
res = http.request(req)
puts "Response HTTP Status Code: #{ res.code }"
puts "Response HTTP Response Body: #{ res.body }"
rescue StandardError => e
puts "HTTP Request failed (#{ e.message })"
end
send_request()
<?php
// get cURL resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, 'https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105');
// authenticate with your API key
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR-API-KEY',
]);
// set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
// return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// send the request and save response to $response
$response = curl_exec($ch);
// stop if fails
if (!$response) {
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;
echo 'Response Body: ' . $response . PHP_EOL;
// close curl resource to free up system resources
curl_close($ch);
>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func sendClassic() {
// Create client
client := &http.Client{}
// Create request
req, err := http.NewRequest("GET", "https://app.scrapingbee.com/api/v1/shopee?url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105", nil)
// Authenticate with your API key
req.Header.Set("Authorization", "Bearer YOUR-API-KEY")
parseFormErr := req.ParseForm()
if parseFormErr != nil {
fmt.Println(parseFormErr)
}
// Fetch Request
resp, err := client.Do(req)
if err != nil {
fmt.Println("Failure : ", err)
}
// Read Response Body
respBody, _ := ioutil.ReadAll(resp.Body)
// Display Results
fmt.Println("response Status : ", resp.Status)
fmt.Println("response Headers : ", resp.Header)
fmt.Println("response Body : ", string(respBody))
}
func main() {
sendClassic()
}
# This API is not available in the CLI.
Add HTML
The add_html parameter controls whether the raw HTML of the page is included in the response alongside the structured data. When set to true, the response will contain an html field with the full page HTML.
Set add_html=true to include the HTML, or add_html=false (the default) to omit it.
curl "https://app.scrapingbee.com/api/v1/shopee?add_html=true&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105" \
-H "Authorization: Bearer YOUR-API-KEY"
# Install the Python Requests library:
# pip install requests
import requests
def send_request():
response = requests.get(
url='https://app.scrapingbee.com/api/v1/shopee',
headers={
'Authorization': 'Bearer YOUR-API-KEY',
},
params={
'add_html': 'true',
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
},
)
print('Response HTTP Status Code: ', response.status_code)
print('Response HTTP Response Body: ', response.content)
send_request()
// Install the Node Axios package
// npm install axios
const axios = require('axios');
axios.get('https://app.scrapingbee.com/api/v1/shopee', {
headers: {
'Authorization': 'Bearer YOUR-API-KEY',
},
params: {
'add_html': 'true',
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
}
}).then(function (response) {
// handle success
console.log(response);
})
import java.io.IOException;
import org.apache.http.client.fluent.*;
public class SendRequest
{
public static void main(String[] args) {
sendRequest();
}
private static void sendRequest() {
// Classic (GET )
try {
// Create request
Content content = Request.Get("https://app.scrapingbee.com/api/v1/shopee?add_html=true&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105")
// Authenticate with your API key
.addHeader("Authorization", "Bearer YOUR-API-KEY")
// Fetch request and return content
.execute().returnContent();
// Print content
System.out.println(content);
}
catch (IOException e) { System.out.println(e); }
}
}
require 'net/http'
require 'net/https'
# Classic (GET )
def send_request
uri = URI('https://app.scrapingbee.com/api/v1/shopee?add_html=true&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105')
# Create client
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
# Create Request
req = Net::HTTP::Get.new(uri)
# Authenticate with your API key
req['Authorization'] = 'Bearer YOUR-API-KEY'
# Fetch Request
res = http.request(req)
puts "Response HTTP Status Code: #{ res.code }"
puts "Response HTTP Response Body: #{ res.body }"
rescue StandardError => e
puts "HTTP Request failed (#{ e.message })"
end
send_request()
<?php
// get cURL resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, 'https://app.scrapingbee.com/api/v1/shopee?add_html=true&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105');
// authenticate with your API key
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR-API-KEY',
]);
// set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
// return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// send the request and save response to $response
$response = curl_exec($ch);
// stop if fails
if (!$response) {
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;
echo 'Response Body: ' . $response . PHP_EOL;
// close curl resource to free up system resources
curl_close($ch);
>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func sendClassic() {
// Create client
client := &http.Client{}
// Create request
req, err := http.NewRequest("GET", "https://app.scrapingbee.com/api/v1/shopee?add_html=true&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105", nil)
// Authenticate with your API key
req.Header.Set("Authorization", "Bearer YOUR-API-KEY")
parseFormErr := req.ParseForm()
if parseFormErr != nil {
fmt.Println(parseFormErr)
}
// Fetch Request
resp, err := client.Do(req)
if err != nil {
fmt.Println("Failure : ", err)
}
// Read Response Body
respBody, _ := ioutil.ReadAll(resp.Body)
// Display Results
fmt.Println("response Status : ", resp.Status)
fmt.Println("response Headers : ", resp.Header)
fmt.Println("response Body : ", string(respBody))
}
func main() {
sendClassic()
}
# This API is not available in the CLI.
Tag
Attach a custom string identifier to any request using the tag parameter. The value will be returned with the response headers. This parameter is optional and has no effect on the scraping behavior.
curl "https://app.scrapingbee.com/api/v1/shopee?tag=your+text&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105" \
-H "Authorization: Bearer YOUR-API-KEY"
# Install the Python Requests library:
# pip install requests
import requests
def send_request():
response = requests.get(
url='https://app.scrapingbee.com/api/v1/shopee',
headers={
'Authorization': 'Bearer YOUR-API-KEY',
},
params={
'tag': 'your text',
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
},
)
print('Response HTTP Status Code: ', response.status_code)
print('Response HTTP Response Body: ', response.content)
send_request()
// Install the Node Axios package
// npm install axios
const axios = require('axios');
axios.get('https://app.scrapingbee.com/api/v1/shopee', {
headers: {
'Authorization': 'Bearer YOUR-API-KEY',
},
params: {
'tag': 'your text',
'url': 'https://shopee.co.id/product-name-i.93014939.1881883105',
}
}).then(function (response) {
// handle success
console.log(response);
})
import java.io.IOException;
import org.apache.http.client.fluent.*;
public class SendRequest
{
public static void main(String[] args) {
sendRequest();
}
private static void sendRequest() {
// Classic (GET )
try {
// Create request
Content content = Request.Get("https://app.scrapingbee.com/api/v1/shopee?tag=your+text&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105")
// Authenticate with your API key
.addHeader("Authorization", "Bearer YOUR-API-KEY")
// Fetch request and return content
.execute().returnContent();
// Print content
System.out.println(content);
}
catch (IOException e) { System.out.println(e); }
}
}
require 'net/http'
require 'net/https'
# Classic (GET )
def send_request
uri = URI('https://app.scrapingbee.com/api/v1/shopee?tag=your+text&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105')
# Create client
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
# Create Request
req = Net::HTTP::Get.new(uri)
# Authenticate with your API key
req['Authorization'] = 'Bearer YOUR-API-KEY'
# Fetch Request
res = http.request(req)
puts "Response HTTP Status Code: #{ res.code }"
puts "Response HTTP Response Body: #{ res.body }"
rescue StandardError => e
puts "HTTP Request failed (#{ e.message })"
end
send_request()
<?php
// get cURL resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, 'https://app.scrapingbee.com/api/v1/shopee?tag=your+text&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105');
// authenticate with your API key
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR-API-KEY',
]);
// set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
// return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// send the request and save response to $response
$response = curl_exec($ch);
// stop if fails
if (!$response) {
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;
echo 'Response Body: ' . $response . PHP_EOL;
// close curl resource to free up system resources
curl_close($ch);
>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func sendClassic() {
// Create client
client := &http.Client{}
// Create request
req, err := http.NewRequest("GET", "https://app.scrapingbee.com/api/v1/shopee?tag=your+text&url=https%3A%2F%2Fshopee.co.id%2Fproduct-name-i.93014939.1881883105", nil)
// Authenticate with your API key
req.Header.Set("Authorization", "Bearer YOUR-API-KEY")
parseFormErr := req.ParseForm()
if parseFormErr != nil {
fmt.Println(parseFormErr)
}
// Fetch Request
resp, err := client.Do(req)
if err != nil {
fmt.Println("Failure : ", err)
}
// Read Response Body
respBody, _ := ioutil.ReadAll(resp.Body)
// Display Results
fmt.Println("response Status : ", resp.Status)
fmt.Println("response Headers : ", resp.Header)
fmt.Println("response Body : ", string(respBody))
}
func main() {
sendClassic()
}
# This API is not available in the CLI.
Credit cost for your requests
Each ScrapingBee plan provides a certain amount of API credits per month.
It costs 75 credits per Shopee API request.