API Documentation
Endpoint: /api
This endpoint summarizes a Hacker News post and its comments.
HTTP Method: GET
Query Parameters:
- url (required): The URL of the Hacker News post to summarize.
- useCustomConfig (optional): Set to 'true' to use custom API configuration.
- apiEndpoint (required if useCustomConfig is true): Custom API endpoint.
- apiKey (required if useCustomConfig is true): Custom API key.
- model (required if useCustomConfig is true): Custom model name.
Response:
{
"articleSummary": string,
"discussionSummary": [
{
"topic": string,
"summary": string,
"views": string[]
}
]
}
Example Usage:
fetch('/api?url=https://news.ycombinator.com/item?id=12345&useCustomConfig=false')
.then(response => response.json())
.then(data => console.log(data));