Articles Analyzed: ${topic.articles.length}
Overall Trend: ${topic.summary.trend}
Key Themes: ${topic.summary.themes.join(', ')}
${topic.articles.map(article => `
${article.headline}
Source: ${article.source}
Key Points:
${article.keyPoints.map(point => `- ${point}
`).join('')}
Impact: ${article.impact}
`).join('')}
`).join('')}
`;
}
```python Python News Extraction
import requests
def extract_news_article(article_url):
api_key = "your_api_key_here"
news_schema = {
"type": "object",
"properties": {
"headline": {"type": "string"},
"author": {"type": "string"},
"publishDate": {"type": "string"},
"category": {"type": "string"},
"summary": {"type": "string", "maxLength": 300},
"keyPoints": {"type": "array", "items": {"type": "string"}},
"quotes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {"type": "string"},
"speaker": {"type": "string"}
}
}
},
"readingTime": {"type": "number"},
"credibilityScore": {"type": "number", "minimum": 1, "maximum": 10}
},
"required": ["headline", "publishDate", "summary"]
}
response = requests.post(
'https://api.weblinq.dev/v1/web/ai-extract',
headers={
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
},
json={
'url': article_url,
'response_format': {
'type': 'json_schema',
'json_schema': news_schema
},
'prompt': 'Extract comprehensive news article information'
}
)
data = response.json()
if not data['success']:
raise Exception(data.get('error', {}).get('message', 'Failed to extract'))
return data['data']['extracted']
````