Python Code Examples
Python is one of the most popular languages for calling the MeowLoad API. This page provides complete example code.
🚀 Using requests
import requests
api_url = "https://api.meowload.net/openapi/extract/post"
api_key = "your-api-key-here"
payload = {"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}
headers = {"x-api-key": api_key, "accept-language": "zh"}
response = requests.post(api_url, json=payload, headers=headers)
if response.status_code == 200:
data = response.json()
print(f"✅ Extraction successful! Media count: {len(data['medias'])}")
for media in data['medias']:
print(f"- {media['media_type']}: {media['resource_url']}")
else:
error = response.json()
print(f"❌ Request failed: {error['message']}")🎯 Using aiohttp for Async Calls
import aiohttp
import asyncio
async def extract_async(url, api_key):
api_url = "https://api.meowload.net/openapi/extract/post"
async with aiohttp.ClientSession() as session:
async with session.post(
api_url,
json={"url": url},
headers={"x-api-key": api_key}
) as response:
return await response.json()
# Concurrently extract multiple URLs
async def batch_extract(urls, api_key):
tasks = [extract_async(url, api_key) for url in urls]
return await asyncio.gather(*tasks)
# Run
urls = [
"https://www.youtube.com/watch?v=video1",
"https://www.youtube.com/watch?v=video2",
]
results = asyncio.run(batch_extract(urls, "your-api-key-here"))