Official Python SDK for Audioscrape API
Project description
Audioscrape Python SDK
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.
Installation
pip install audioscrape-sdk
Authentication
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")
Usage Examples
Search API
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']}")
Notifications API
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)
Advanced Query Syntax
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 term2orterm1 -term2- Exclude content with second termterm*- Wildcard matching (prefix search)(term1 OR term2) AND term3- Grouping for complex queries
Error Handling
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}")
License
This SDK is distributed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file audioscrape_sdk-0.1.0.tar.gz.
File metadata
- Download URL: audioscrape_sdk-0.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9967ab483099f7271196ea4ffa2cd566c108d81668de4d7126a6632fd3258c7
|
|
| MD5 |
753d7fe30a4854a539ee4e3fd8a6fc52
|
|
| BLAKE2b-256 |
be5ea96151171ed7255331461448dba59fe602f2f56d9e440bae491e298e244d
|
File details
Details for the file audioscrape_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: audioscrape_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdcd06073d4bd0ba89f6a4956d58c424f4a83e510004e3130ae5e87757ee8c60
|
|
| MD5 |
02d5eb325f0f9c83d58ffe64fad787be
|
|
| BLAKE2b-256 |
ea23f170e7abd16b61dd4cc3568fded6944b4f2e19b527b1181c2a40ab795082
|