Using the Snipcast API
Snipcast offers an API for paid users that allows you to programmatically summarize podcasts. You can use this to build your own integrations with other apps and services. This guide will walk you through how to use the API.
Getting Your API Key
To use the Snipcast API, you’ll need an API key. To get one, go to the API key page under “My Account”.
API Endpoints
Summarize Endpoint
URL: https://snipcast.io/api/summarize
Method: POST
Authentication: Bearer token
This endpoint allows you to submit a podcast URL for summarization.
Request Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json Request Body
Simply pass the URL of the podcast episode you want to summarize on this JSON format:
{
"podcastUrl": "https://open.spotify.com/episode/..."
} Response
The API will respond with information about the podcast that was submitted for summarization:
{
"contentType": "podcast",
"showName": "Example Podcast",
"episodeName": "Episode Title",
"audioUrl": "https://example.com/audio.mp3",
"imageUrl": "https://example.com/cover.jpg",
"processingTime": 5
} The actual summary will be sent to the email associated with your account once processing is complete.
Important Notes
- The API is asynchronous - you’ll receive a confirmation that your request was received, but the actual summary will be delivered via email
- The API uses the same usage limits as your account
Example: Making an API Request with cURL
curl -X POST https://snipcast.io/api/summarize
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{"podcastUrl": "https://example.com/podcast-episode"}' Example: Making an API Request with JavaScript
async function summarizePodcast(apiKey, podcastUrl) {
const response = await fetch("https://snipcast.io/api/summarize", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
podcastUrl: podcastUrl,
}),
});
const data = await response.json();
if (!response.ok) {
throw new Error(`Error: ${data.errorMessage}`);
}
return data;
} Example: Making an API Request with Python
import requests
def summarize_podcast(api_key, podcast_url):
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
payload = {
'podcastUrl': podcast_url
}
response = requests.post(
'https://snipcast.io/api/summarize',
headers=headers,
json=payload
)
if response.status_code != 200:
error_data = response.json()
raise Exception(f"Error: {error_data.get('errorMessage')}")
return response.json() Need Help?
If you encounter any issues or have questions about the API, please contact us at [email protected].