Skip to main content

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 phrases
  • term1 AND term2 - Both terms must be present
  • term1 OR term2 - Either term can be present
  • term1 NOT term2 or term1 -term2 - Exclude content with second term
  • term* - 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audioscrape_sdk-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audioscrape_sdk-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

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

Hashes for audioscrape_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a9967ab483099f7271196ea4ffa2cd566c108d81668de4d7126a6632fd3258c7
MD5 753d7fe30a4854a539ee4e3fd8a6fc52
BLAKE2b-256 be5ea96151171ed7255331461448dba59fe602f2f56d9e440bae491e298e244d

See more details on using hashes here.

File details

Details for the file audioscrape_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for audioscrape_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdcd06073d4bd0ba89f6a4956d58c424f4a83e510004e3130ae5e87757ee8c60
MD5 02d5eb325f0f9c83d58ffe64fad787be
BLAKE2b-256 ea23f170e7abd16b61dd4cc3568fded6944b4f2e19b527b1181c2a40ab795082

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page