Scrape Raw
Get the raw HTML source code as received from the server without JavaScript execution. Faster and more lightweight than full rendering.
Overview
The raw response type returns the source HTML (or file content if URL is not an HTML page) exactly as received from the URL without running JavaScript. This is useful when:
- You need the original server response
- The page doesn't require JavaScript to load content
- You want the fastest possible response time
- You're scraping static content
INFO — Note
When using
response_type=raw, thejs=1parameter is ignored since no JavaScript execution occurs.
Basic Request
Set response_type=raw to get the raw HTML source.
GET https://api.ujeebu.com/scrape?response_type=raw
curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=raw' \
-H "ApiKey: YOUR_API_KEY"const response = await fetch(
'https://api.ujeebu.com/scrape?url=https://example.com&response_type=raw',
{
headers: { 'ApiKey': 'YOUR_API_KEY' }
}
);
const html = await response.text();
console.log(html);import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
const client = new UjeebuClient(process.env.UJEEBU_API_KEY);
const html = await client.scrape('https://example.com', {
response_type: 'raw'
});
console.log(html);import requests
response = requests.get(
'https://api.ujeebu.com/scrape',
params={
'url': 'https://example.com',
'response_type': 'raw'
},
headers={'ApiKey': 'YOUR_API_KEY'}
)
print(response.text)from ujeebu_python import UjeebuClient
ujeebu = UjeebuClient(api_key="YOUR_API_KEY")
html = ujeebu.scrape(
url='https://example.com',
params={'response_type': 'raw'}
)
print(html)import okhttp3.*;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.ujeebu.com/scrape?url=https://example.com&response_type=raw")
.addHeader("ApiKey", "YOUR_API_KEY")
.build();
Response response = client.newCall(request).execute();
String html = response.body().string();
System.out.println(html);<?php
$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
'url' => 'https://example.com',
'response_type' => 'raw'
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'ApiKey: YOUR_API_KEY'
]);
$html = curl_exec($ch);
curl_close($ch);
echo $html;package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.ujeebu.com/scrape?url=https://example.com&response_type=raw"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("ApiKey", "YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}package main
import (
"fmt"
"github.com/ujeebu/ujeebu-go"
)
func main() {
client, _ := ujeebu.NewClient("YOUR-API-KEY")
html, _, err := client.Scrape(ujeebu.ScrapeParams{
URL: "https://example.com",
ResponseType: "raw",
})
if err != nil {
panic(err)
}
fmt.Println(html)
}Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url |
string |
Yes | - |
The URL to scrape. |
response_type |
string |
Yes | html |
Set to 'raw' to get the raw HTML source. |
timeout |
number |
No | 60 |
Maximum seconds before request timeout. |
proxy_type |
string |
No | rotating |
Proxy type: 'rotating', 'premium', 'residential', 'custom'. |
proxy_country |
string |
No | US |
Country ISO code for premium proxy. |
cookies |
string |
No | null |
Cookies to send with the request. |
json |
boolean |
No | false |
Return response as JSON with html in a field. |
Response
The response is the raw HTML source code as text. If json=true, the response is wrapped in a JSON object:
{
"success": true,
"html": "<!DOCTYPE html><html>...</html>",
"html_source": null,
"screenshot": null,
"pdf": null
}
Use Cases
Static Content Scraping
Perfect for websites that don't rely on JavaScript for content loading:
- News articles with server-side rendering
- Blog posts
- Documentation pages
- Product pages with static content
API Response Capture
When the URL returns JSON or XML data directly:
curl -X GET 'https://api.ujeebu.com/scrape?url=https://api.example.com/data.json&response_type=raw' \
-H "ApiKey: YOUR_API_KEY"const response = await fetch(
'https://api.ujeebu.com/scrape?url=https://api.example.com/data.json&response_type=raw',
{ headers: { 'ApiKey': 'YOUR_API_KEY' } }
);
const data = await response.json();
console.log(data);import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
const client = new UjeebuClient(process.env.UJEEBU_API_KEY);
const jsonData = await client.scrape('https://api.example.com/data.json', {
response_type: 'raw'
});
const data = JSON.parse(jsonData);
console.log(data);import requests
response = requests.get(
'https://api.ujeebu.com/scrape',
params={
'url': 'https://api.example.com/data.json',
'response_type': 'raw'
},
headers={'ApiKey': 'YOUR_API_KEY'}
)
data = response.json()
print(data)from ujeebu_python import UjeebuClient
import json
ujeebu = UjeebuClient(api_key="YOUR_API_KEY")
json_data = ujeebu.scrape(
url='https://api.example.com/data.json',
params={'response_type': 'raw'}
)
data = json.loads(json_data)
print(data)import okhttp3.*;
import org.json.*;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.ujeebu.com/scrape?url=https://api.example.com/data.json&response_type=raw")
.addHeader("ApiKey", "YOUR_API_KEY")
.build();
Response response = client.newCall(request).execute();
JSONObject data = new JSONObject(response.body().string());
System.out.println(data);<?php
$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
'url' => 'https://api.example.com/data.json',
'response_type' => 'raw'
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['ApiKey: YOUR_API_KEY']);
$jsonData = curl_exec($ch);
curl_close($ch);
$data = json_decode($jsonData, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.ujeebu.com/scrape?url=https://api.example.com/data.json&response_type=raw"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("ApiKey", "YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]interface{}
json.Unmarshal(body, &data)
fmt.Println(data)
}package main
import (
"encoding/json"
"fmt"
"github.com/ujeebu/ujeebu-go"
)
func main() {
client, _ := ujeebu.NewClient("YOUR-API-KEY")
jsonData, _, _ := client.Scrape(ujeebu.ScrapeParams{
URL: "https://api.example.com/data.json",
ResponseType: "raw",
})
var data map[string]interface{}
json.Unmarshal([]byte(jsonData), &data)
fmt.Println(data)
}File Downloads
Download files up to 2MB when the content type is not HTML:
curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com/document.xml&response_type=raw' \
-H "ApiKey: YOUR_API_KEY" \
-o document.xmlconst fs = require('fs');
const response = await fetch(
'https://api.ujeebu.com/scrape?url=https://example.com/document.xml&response_type=raw',
{ headers: { 'ApiKey': 'YOUR_API_KEY' } }
);
const content = await response.text();
fs.writeFileSync('document.xml', content);import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
import fs from 'fs';
const client = new UjeebuClient(process.env.UJEEBU_API_KEY);
const content = await client.scrape('https://example.com/document.xml', {
response_type: 'raw'
});
fs.writeFileSync('document.xml', content);import requests
response = requests.get(
'https://api.ujeebu.com/scrape',
params={
'url': 'https://example.com/document.xml',
'response_type': 'raw'
},
headers={'ApiKey': 'YOUR_API_KEY'}
)
with open('document.xml', 'w') as f:
f.write(response.text)from ujeebu_python import UjeebuClient
ujeebu = UjeebuClient(api_key="YOUR_API_KEY")
content = ujeebu.scrape(
url='https://example.com/document.xml',
params={'response_type': 'raw'}
)
with open('document.xml', 'w') as f:
f.write(content)import okhttp3.*;
import java.io.*;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.ujeebu.com/scrape?url=https://example.com/document.xml&response_type=raw")
.addHeader("ApiKey", "YOUR_API_KEY")
.build();
Response response = client.newCall(request).execute();
String content = response.body().string();
try (FileWriter writer = new FileWriter("document.xml")) {
writer.write(content);
}<?php
$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
'url' => 'https://example.com/document.xml',
'response_type' => 'raw'
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['ApiKey: YOUR_API_KEY']);
$content = curl_exec($ch);
curl_close($ch);
file_put_contents('document.xml', $content);package main
import (
"io"
"net/http"
"os"
)
func main() {
url := "https://api.ujeebu.com/scrape?url=https://example.com/document.xml&response_type=raw"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("ApiKey", "YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
content, _ := io.ReadAll(resp.Body)
os.WriteFile("document.xml", content, 0644)
}package main
import (
"os"
"github.com/ujeebu/ujeebu-go"
)
func main() {
client, _ := ujeebu.NewClient("YOUR-API-KEY")
content, _, _ := client.Scrape(ujeebu.ScrapeParams{
URL: "https://example.com/document.xml",
ResponseType: "raw",
})
os.WriteFile("document.xml", []byte(content), 0644)
}Spin up an API key in 60 seconds
Free tier: 5,000 credits, no card, full access to every endpoint on this page.