curl -X POST "https://api.ujeebu.com/scrape" \
-H "ApiKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk",
"js": true,
"wait_for": "h1[data-buy-box-listing-title]",
"response_type": "json",
"extract_rules": {
"title": {
"selector": "h1[data-buy-box-listing-title]",
"type": "text"
},
"price": {
"selector": "p[data-buy-box-region-price]",
"type": "text"
},
"main_image": {
"selector": "img[data-listing-main-image]",
"type": "image"
},
"shop_name": {
"selector": "a[href*=\"/shop/\"] span",
"type": "text"
},
"rating": {
"selector": "input[name=\"rating\"]",
"type": "attr",
"attribute": "value"
},
"description": {
"selector": "div[data-product-details-description]",
"type": "text"
}
}
}'
from ujeebu_python import UjeebuClient
uj = UjeebuClient(api_key="YOUR_API_KEY")
res = uj.scrape_with_rules(
url="https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk",
extract_rules={
"title": {
"selector": "h1[data-buy-box-listing-title]",
"type": "text"
},
"price": {
"selector": "p[data-buy-box-region-price]",
"type": "text"
},
"main_image": {
"selector": "img[data-listing-main-image]",
"type": "image"
},
"shop_name": {
"selector": "a[href*=\"/shop/\"] span",
"type": "text"
},
"rating": {
"selector": "input[name=\"rating\"]",
"type": "attr",
"attribute": "value"
},
"description": {
"selector": "div[data-product-details-description]",
"type": "text"
}
},
params={
"js": True,
"wait_for": "h1[data-buy-box-listing-title]",
"response_type": "json"
},
)
print(res.json())
const { UjeebuClient } = require('@ujeebu-org/ujeebu-sdk');
const client = new UjeebuClient("YOUR_API_KEY");
(async () => {
const res = await client.scrape("https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk", {
extract_rules: {
"title": {
"selector": "h1[data-buy-box-listing-title]",
"type": "text"
},
"price": {
"selector": "p[data-buy-box-region-price]",
"type": "text"
},
"main_image": {
"selector": "img[data-listing-main-image]",
"type": "image"
},
"shop_name": {
"selector": "a[href*=\"/shop/\"] span",
"type": "text"
},
"rating": {
"selector": "input[name=\"rating\"]",
"type": "attr",
"attribute": "value"
},
"description": {
"selector": "div[data-product-details-description]",
"type": "text"
}
},
...{
"js": true,
"wait_for": "h1[data-buy-box-listing-title]",
"response_type": "json"
} });
console.log(res.data);
})();
package main
import (
"fmt"
"log"
"github.com/ujeebu/ujeebu-go"
)
func main() {
client, err := ujeebu.NewClient("YOUR_API_KEY")
if err != nil {
log.Fatal(err)
}
res, _, err := client.Scrape(ujeebu.ScrapeParams{
URL: "https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk",
JS: true,
WaitFor: "h1[data-buy-box-listing-title]",
ResponseType: "json",
ExtractRules: map[string]any{
"title": map[string]any{
"selector": "h1[data-buy-box-listing-title]",
"type": "text",
},
"price": map[string]any{
"selector": "p[data-buy-box-region-price]",
"type": "text",
},
"main_image": map[string]any{
"selector": "img[data-listing-main-image]",
"type": "image",
},
"shop_name": map[string]any{
"selector": "a[href*=\"/shop/\"] span",
"type": "text",
},
"rating": map[string]any{
"selector": "input[name=\"rating\"]",
"type": "attr",
"attribute": "value",
},
"description": map[string]any{
"selector": "div[data-product-details-description]",
"type": "text",
},
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(res)
}
import requests
import json
# API configuration
api_key = "YOUR_API_KEY"
url = "https://api.ujeebu.com/scrape"
# Request payload
payload = {
"url": "https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk",
"js": True,
"wait_for": "h1[data-buy-box-listing-title]",
"response_type": "json",
"extract_rules": {
"title": {
"selector": "h1[data-buy-box-listing-title]",
"type": "text"
},
"price": {
"selector": "p[data-buy-box-region-price]",
"type": "text"
},
"main_image": {
"selector": "img[data-listing-main-image]",
"type": "image"
},
"shop_name": {
"selector": "a[href*=\"/shop/\"] span",
"type": "text"
},
"rating": {
"selector": "input[name=\"rating\"]",
"type": "attr",
"attribute": "value"
},
"description": {
"selector": "div[data-product-details-description]",
"type": "text"
}
}
}
# Make request
response = requests.post(
url,
headers={
"ApiKey": api_key,
"Content-Type": "application/json"
},
json=payload
)
# Handle response
if response.status_code == 200:
data = response.json()
print(json.dumps(data, indent=2))
else:
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
// API configuration
const apiKey = process.env.UJEEBU_API_KEY || 'YOUR_API_KEY';
const apiUrl = 'https://api.ujeebu.com/scrape';
// Request payload
const payload = {
"url": "https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk",
"js": true,
"wait_for": "h1[data-buy-box-listing-title]",
"response_type": "json",
"extract_rules": {
"title": {
"selector": "h1[data-buy-box-listing-title]",
"type": "text"
},
"price": {
"selector": "p[data-buy-box-region-price]",
"type": "text"
},
"main_image": {
"selector": "img[data-listing-main-image]",
"type": "image"
},
"shop_name": {
"selector": "a[href*=\"/shop/\"] span",
"type": "text"
},
"rating": {
"selector": "input[name=\"rating\"]",
"type": "attr",
"attribute": "value"
},
"description": {
"selector": "div[data-product-details-description]",
"type": "text"
}
}
};
// Make request
axios.post(apiUrl, payload, {
headers: {
'ApiKey': apiKey,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error.response?.status, error.response?.data);
});
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API configuration
apiKey := "YOUR_API_KEY"
apiURL := "https://api.ujeebu.com/scrape"
// Request payload
payload := {
"url": "https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk",
"js": true,
"wait_for": "h1[data-buy-box-listing-title]",
"response_type": "json",
"extract_rules": {
"title": {
"selector": "h1[data-buy-box-listing-title]",
"type": "text"
},
"price": {
"selector": "p[data-buy-box-region-price]",
"type": "text"
},
"main_image": {
"selector": "img[data-listing-main-image]",
"type": "image"
},
"shop_name": {
"selector": "a[href*=\"/shop/\"] span",
"type": "text"
},
"rating": {
"selector": "input[name=\"rating\"]",
"type": "attr",
"attribute": "value"
},
"description": {
"selector": "div[data-product-details-description]",
"type": "text"
}
}
}
// Marshal payload
jsonData, err := json.Marshal(payload)
if err != nil {
log.Fatal(err)
}
// Create request
req, err := http.NewRequest("POST", apiURL, bytes.NewBuffer(jsonData))
if err != nil {
log.Fatal(err)
}
// Set headers
req.Header.Set("ApiKey", apiKey)
req.Header.Set("Content-Type", "application/json")
// Make request
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
// Read response
body, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(body))
}
<?php
$apiKey = getenv('UJEEBU_API_KEY') ?: 'YOUR_API_KEY';
$apiUrl = 'https://api.ujeebu.com/scrape';
// Request payload
$payload = array (
'url' => 'https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk',
'js' => true,
'wait_for' => 'h1[data-buy-box-listing-title]',
'response_type' => 'json',
'extract_rules' =>
array (
'title' =>
array (
'selector' => 'h1[data-buy-box-listing-title]',
'type' => 'text',
),
'price' =>
array (
'selector' => 'p[data-buy-box-region-price]',
'type' => 'text',
),
'main_image' =>
array (
'selector' => 'img[data-listing-main-image]',
'type' => 'image',
),
'shop_name' =>
array (
'selector' => 'a[href*="/shop/"] span',
'type' => 'text',
),
'rating' =>
array (
'selector' => 'input[name="rating"]',
'type' => 'attr',
'attribute' => 'value',
),
'description' =>
array (
'selector' => 'div[data-product-details-description]',
'type' => 'text',
),
),
);
// Initialize cURL
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $apiUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'ApiKey: ' . $apiKey,
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($payload)
]);
// Execute request
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Handle response
if ($httpCode === 200) {
$data = json_decode($response, true);
print_r($data);
} else {
echo "Error: $httpCode - $response";
}
?>
use reqwest;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box> {
// API configuration
let api_key = "YOUR_API_KEY";
let api_url = "https://api.ujeebu.com/scrape";
// Request payload
let payload = json!({"url":"https://www.etsy.com/listing/1905926795/foldable-american-pine-laptop-bed-desk","js":true,"wait_for":"h1[data-buy-box-listing-title]","response_type":"json","extract_rules":{"title":{"selector":"h1[data-buy-box-listing-title]","type":"text"},"price":{"selector":"p[data-buy-box-region-price]","type":"text"},"main_image":{"selector":"img[data-listing-main-image]","type":"image"},"shop_name":{"selector":"a[href*=\"/shop/\"] span","type":"text"},"rating":{"selector":"input[name=\"rating\"]","type":"attr","attribute":"value"},"description":{"selector":"div[data-product-details-description]","type":"text"}}});
// Create client
let client = reqwest::Client::new();
// Make request
let response = client
.post(api_url)
.header("ApiKey", api_key)
.header("Content-Type", "application/json")
.json(&payload)
.send()
.await?;
// Handle response
if response.status().is_success() {
let data = response.json::().await?;
println!("{:#}", data);
} else {
eprintln!("Error: {} - {}", response.status(), response.text().await?);
}
Ok(())
}