POST
/
contents
curl --request POST \
--url https://api.valyu.network/contents \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"urls": [
"https://example.com/article1",
"https://example.com/article2"
],
"response_length": "medium",
"summary": false
}'
{
"success": true,
"error": null,
"tx_id": "tx_12345678-1234-1234-1234-123456789abc",
"results": [
{
"title": "AI Breakthrough in Natural Language Processing",
"url": "https://example.com/article1?utm_source=valyu",
"content": "# AI Breakthrough in Natural Language Processing\n\nThis article discusses...",
"description": "Latest AI developments",
"source": "web",
"price": 0.002,
"length": 12840,
"data_type": "unstructured",
"source_type": "news_article",
"publication_date": "2024-01-15",
"id": "https://example.com/article1",
"image_url": {}
}
],
"urls_requested": 2,
"urls_processed": 2,
"urls_failed": 0,
"total_cost_dollars": 0.004,
"total_characters": 25680
}

Authorizations

x-api-key
string
header
required

Your Valyu API key. Get one at platform.valyu.network

Body

application/json
urls
string<uri>[]
required

List of URLs to process (maximum 10 URLs per request)

Required array length: 1 - 10 elements
Example:
[
"https://example.com/article1",
"https://example.com/article2"
]
response_length
default:short

Content length configuration:

  • "short": 25,000 characters (good for summaries)
  • "medium": 50,000 characters (good for articles)
  • "large": 100,000 characters (good for academic papers)
  • "max": No character limit
  • Custom integer: Specific character limit
Available options:
short,
medium,
large,
max
Example:

"medium"

extract_effort
enum<string>
default:normal

Processing effort level:

  • "normal": Standard extraction speed and quality
  • "high": Enhanced extraction with better content quality (slower)
Available options:
normal,
high
Example:

"normal"

summary
default:false

Toggle AI processing (false is default)

Example:

true

Response

All URLs processed successfully

success
boolean

Whether the request was successful

Example:

true

error
string | null

Error message if any issues occurred

Example:

null

tx_id
string

Unique transaction ID for tracking and support

Example:

"tx_12345678-1234-1234-1234-123456789abc"

results
object[]

Array of processed content results

urls_requested
integer

Number of URLs submitted in the request

Required range: 1 <= x <= 10
Example:

2

urls_processed
integer

Number of URLs successfully processed

Required range: x >= 0
Example:

2

urls_failed
integer

Number of URLs that failed processing

Required range: x >= 0
Example:

0

total_cost_dollars
number

Actual cost charged (only for successful URLs)

Required range: x >= 0
Example:

0.004

total_characters
integer

Total characters across all processed results

Required range: x >= 0
Example:

25680