Official Python client library for the Audioscrape API. This library provides a clean, Pythonic interface to interact with Audioscrape's various endpoints for searching podcast transcriptions and managing notification subscriptions.
pip install audioscrape-sdk
To use the Audioscrape API, you need an API key, which can be obtained from your Audioscrape dashboard.
import audioscrape
client = audioscrape.Client(api_key="YOUR_API_KEY")
Search for podcast segments that mention specific terms:
# Basic search
results = client.search.search("machine learning AND neural networks")
# With pagination
results = client.search.search(
query="machine learning AND neural networks",
limit=10,
offset=0
)
# Print the first result
if results["results"]:
first_match = results["results"][0]
print(f"Podcast: {first_match['podcast']['title']}")
print(f"Episode: {first_match['episode']['title']}")
print(f"Match: {first_match['matches'][0]['text']}")
Create and manage search term notifications:
# Create a notification
notification = client.notifications.create_notification(
search_term="\"artificial intelligence\" AND ethics",
webhook_url="https://your-webhook.com/endpoint",
email_recipient="user@example.com"
)
print(f"Created notification with ID: {notification['id']}")
# List all notifications
notifications = client.notifications.list_notifications()
for notification in notifications:
print(f"ID: {notification['id']}, Term: {notification['search_term']}")
# Delete a notification
client.notifications.delete_notification(notification_id=123)
Audioscrape supports advanced query syntax for more precise searches:
"exact phrase"
- Match exact phrasesterm1 AND term2
- Both terms must be presentterm1 OR term2
- Either term can be presentterm1 NOT term2
orterm1 -term2
- Exclude content with second termterm*
- Wildcard matching (prefix search)(term1 OR term2) AND term3
- Grouping for complex queries
The SDK will raise exceptions for API errors:
import requests
from audioscrape import Client
try:
client = Client(api_key="YOUR_API_KEY")
results = client.search.search("artificial intelligence")
except requests.exceptions.HTTPError as e:
print(f"API error: {e}")
This SDK is distributed under the MIT license.