curl -X POST "https://api.ujeebu.com/scrape" \
-H "ApiKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com"
}'
from ujeebu_python import UjeebuClient
# Initialize client
ujeebu = UjeebuClient(api_key="YOUR_API_KEY")
# Make request
response = ujeebu.scrape(
url="https://example.com",
params={
"url": "https://example.com"
}
)
# Handle response
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Error: {response.status_code}")
import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
// Initialize client
const client = new UjeebuClient(process.env.UJEEBU_API_KEY);
// Make request
const response = await client.scrape(
"https://example.com",
{
"url": "https://example.com"
}
);
// Handle response
console.log(response.data);
package main
import (
"fmt"
"log"
"github.com/ujeebu-org/ujeebu-sdk-go/ujeebu"
)
func main() {
// Initialize client
client := ujeebu.NewClient("YOUR_API_KEY")
// Configure options
options := &ujeebu.ScrapeOptions{
}
// Make request
response, err := client.Scrape("https://example.com", options)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(response))
}
import requests
import json
# API configuration
api_key = "YOUR_API_KEY"
url = "https://api.ujeebu.com/scrape"
# Request payload
payload = {
"url": "https://example.com"
}
# 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://example.com"
};
// 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://example.com"
}
// 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://example.com',
);
// 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://example.com"});
// 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(())
}