Article Preview API
Extract article preview metadata quickly without full content analysis. Faster than full extraction as it relies primarily on meta tags.
Authentication
All API requests require authentication using an API key. Include your API key in the request header.
INFO — Get your API key
Sign up for a free account to receive your API key instantly at ujeebu.com/signup.
Basic Request
GET https://api.ujeebu.com/card
curl -X GET 'https://api.ujeebu.com/card?url=https://example.com/article' \
-H "ApiKey: YOUR_API_KEY"const response = await fetch('https://api.ujeebu.com/card?url=https://example.com/article', {
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 card = await client.preview('https://example.com/article');
console.log(card);import requests
response = requests.get(
'https://api.ujeebu.com/card',
params={'url': 'https://example.com/article'},
headers={'ApiKey': 'YOUR_API_KEY'}
)
print(response.json())from ujeebu_python import UjeebuClient
ujeebu = UjeebuClient(api_key='YOUR_API_KEY')
card = ujeebu.preview(
url='https://example.com/article'
)
print(card)OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.ujeebu.com/card?url=https://example.com/article")
.addHeader("ApiKey", "YOUR_API_KEY")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.ujeebu.com/card?url=https://example.com/article',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'ApiKey: YOUR_API_KEY'
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.ujeebu.com/card?url=https://example.com/article", nil)
req.Header.Add("ApiKey", "YOUR_API_KEY")
res, _ := client.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}package main
import (
"fmt"
"github.com/ujeebu/ujeebu-go"
)
func main() {
client, err := ujeebu.NewClient("YOUR_API_KEY")
if err != nil {
panic(err)
}
card, _, err := client.Card(ujeebu.CardParams{
URL: "https://example.com/article",
})
if err != nil {
panic(err)
}
fmt.Println(card)
}Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url |
string |
Yes | - |
URL of article to be extracted. |
js |
boolean |
No | false |
Indicates whether to execute JavaScript or not. Set to 'auto' to let the extractor decide. |
timeout |
number |
No | 60 |
Maximum number of seconds before request timeout. |
js_timeout |
number |
No | 60 |
When js is enabled, indicates how many seconds the API should wait for the JS engine to render the supplied URL. |
proxy_type |
string |
No | rotating |
Indicates type of proxy to use. Possible values: 'rotating', 'advanced', 'premium', 'residential', 'custom'. |
proxy_country |
string |
No | US |
Country ISO 3166-1 alpha-2 code to proxy from. Valid only when premium proxy type is chosen. |
custom_proxy |
string |
No | null |
URI for your custom proxy. Applicable and required only if proxy_type=custom. |
auto_proxy |
boolean |
No | false |
Enable advanced proxy fallback when rotating proxy is not working. |
session_id |
alphanumeric |
No | null |
Alphanumeric identifier (1-16 chars) to route multiple requests from the same proxy instance. |
UJB-headerName |
string |
No | null |
Custom headers to send to target URL. Useful for paywalled content. |
Response Format
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | successful operation | SuccessResponse |
| 400 | Bad Request | Invalid parameter value | APIResponseError |
Article Card Schema
{
"url": "string",
"lang": "string",
"favicon": "string",
"title": "string",
"summary": "string",
"author": "string",
"date_published": "string",
"date_modified": "string",
"image": "string",
"site_name": "string"
}
| Name | Type | Description |
|---|---|---|
| url | string | the URL parameter. |
| lang | string | the language of the article. |
| favicon | string | Domain favicon. |
| title | string | the title of the article. |
| summary | string | the description of the article. |
| author | string | the author of the article. |
| date_published | string | the publish date of the article. |
| date_modified | string | the modified date of the article. |
| image | string | the main image of the article. |
| site_name | string | the site name of the article. |
Error Response Schema
{
"url": "string",
"message": "string",
"errors": ["string"]
}
| Name | Type | Description |
|---|---|---|
| url | string | Given URL |
| message | string | Error message |
| errors | [string] | List of all errors |
Code Example
This will get the meta info for article https://ujeebu.com/blog/how-to-extract-clean-text-from-html/
The code above will generate the following response:
{
"author": "Sam",
"title": "Extracting clean data from blog and news articles",
"summary": "Several open source tools allow the extraction of clean text from article HTML. We list the most popular ones below, and run a benchmark to see how they stack up against the Ujeebu API",
"date_published": "2019-08-09 12:42:25",
"date_modified": "2021-05-02 20:22:34",
"favicon": ":///blog/favicon.png",
"charset": "utf-8",
"image": "https://ujeebu.com/blog/content/images/2021/05/ujb-blog-benchmark.png",
"lang": "en",
"keywords": [],
"site_name": "Ujeebu blog",
"time": 1.501387119293213
}
Spin up an API key in 60 seconds
Free tier: 5,000 credits, no card, full access to every endpoint on this page.