saverapi-client 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {saverapi_client-2.0.0/saverapi_client.egg-info → saverapi_client-2.0.2}/PKG-INFO +347 -3
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/README.md +344 -2
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/pyproject.toml +2 -0
- saverapi_client-2.0.2/saverapi/_version.py +1 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2/saverapi_client.egg-info}/PKG-INFO +347 -3
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/tests/test_client.py +1 -1
- saverapi_client-2.0.0/saverapi/_version.py +0 -1
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/LICENSE +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi/__init__.py +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi/async_client.py +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi/cli.py +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi/client.py +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi/exceptions.py +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi/py.typed +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi_client.egg-info/SOURCES.txt +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi_client.egg-info/dependency_links.txt +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi_client.egg-info/entry_points.txt +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi_client.egg-info/requires.txt +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi_client.egg-info/top_level.txt +0 -0
- {saverapi_client-2.0.0 → saverapi_client-2.0.2}/setup.cfg +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: saverapi-client
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: Official Python SDK for SaverAPI.NET — video downloader API for YouTube (4K, MP3), Instagram, TikTok, Facebook, X, Pinterest and Threads, Telegram bot file_id, Shazam, music search, NSFW scan. Sync, async, CLI.
|
|
5
5
|
Author-email: "SaverAPI.NET" <saverapinet@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://saverapi.net
|
|
8
8
|
Project-URL: Documentation, https://saverapi.net/docs
|
|
9
|
+
Project-URL: Source, https://github.com/saverapinet/saverapi-python
|
|
10
|
+
Project-URL: Issues, https://github.com/saverapinet/saverapi-python/issues
|
|
9
11
|
Project-URL: API catalog, https://saverapi.net/all-in-one-downloader-api
|
|
10
12
|
Project-URL: YouTube Downloader API, https://saverapi.net/youtube-downloader-api
|
|
11
13
|
Project-URL: Instagram Downloader API, https://saverapi.net/instagram-downloader-api
|
|
@@ -54,6 +56,7 @@ Official client for **[SaverAPI.NET](https://saverapi.net)**: download videos, R
|
|
|
54
56
|
[](https://pypi.org/project/saverapi-client/)
|
|
55
57
|
[](https://pypi.org/project/saverapi-client/)
|
|
56
58
|
[](#license)
|
|
59
|
+
[](https://github.com/saverapinet/saverapi-python/actions/workflows/tests.yml)
|
|
57
60
|
[](https://pypi.org/project/saverapi-client/)
|
|
58
61
|
[](https://saverapi.net/docs)
|
|
59
62
|
[](https://t.me/SaverAPI)
|
|
@@ -73,9 +76,10 @@ Get a free API key at **[saverapi.net](https://saverapi.net/auth/register)** —
|
|
|
73
76
|
- **YouTube from 144p to 4K** — `2160`, `1440`, `1080`, `720`… or `mp3` audio, with no yt-dlp, ffmpeg, proxies or cookies to maintain.
|
|
74
77
|
- **Built for Telegram bots** — get a ready `file_id` for your own bot and send a YouTube video instantly, without downloading or re-uploading it.
|
|
75
78
|
- **Sync, async and CLI** — `SaverAPI` (requests), `AsyncSaverAPI` (httpx, for aiogram / FastAPI) and a `saverapi` terminal command.
|
|
79
|
+
- **Documented responses** — a real JSON sample and field table for every method, [right here](#response-reference).
|
|
76
80
|
- **Production ready** — automatic retries, typed exceptions, type hints, Python 3.8–3.13.
|
|
77
81
|
|
|
78
|
-
**Contents:** [Quick start](#quick-start) · [Supported platforms](#supported-platforms) · [Examples](#examples) · [Async](#async-aiogram-fastapi-asyncio) · [Command line](#command-line) · [Errors and retries](#errors-and-retries) · [FAQ](#faq) · [Changelog](#changelog)
|
|
82
|
+
**Contents:** [Quick start](#quick-start) · [Supported platforms](#supported-platforms) · [Examples](#examples) · [Response reference](#response-reference) · [Async](#async-aiogram-fastapi-asyncio) · [Command line](#command-line) · [Errors and retries](#errors-and-retries) · [FAQ](#faq) · [Changelog](#changelog)
|
|
79
83
|
|
|
80
84
|
---
|
|
81
85
|
|
|
@@ -114,7 +118,7 @@ One call, one parameter: the **All-in-One downloader** recognises the platform f
|
|
|
114
118
|
| Account balance (free) | `api.info_balance()` | `/infobalans` |
|
|
115
119
|
| Key statistics (free) | `api.api_keys_statistics()` | `/api-keys/all-statistics` |
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
What each method returns: **[Response reference](#response-reference)** below. Live parameter reference: **[saverapi.net/docs](https://saverapi.net/docs)**. Endpoints added to the catalog later can be called with `api.request("/endpoint-path", {"param": "value"})`.
|
|
118
122
|
|
|
119
123
|
## Examples
|
|
120
124
|
|
|
@@ -188,6 +192,338 @@ top = api.shazam_top("united-states")
|
|
|
188
192
|
print(api.info_balance())
|
|
189
193
|
```
|
|
190
194
|
|
|
195
|
+
## Response reference
|
|
196
|
+
|
|
197
|
+
Every method returns the API's JSON decoded into a plain `dict`. The samples below are real responses (long URLs and lists shortened with `…`). Fields can be `null` when the source has no value, so prefer `.get()` for optional ones.
|
|
198
|
+
|
|
199
|
+
| Method | Key fields in the response |
|
|
200
|
+
|---|---|
|
|
201
|
+
| [`download()`](#download--all-in-one-downloader) | `hosting`, `type`, `download_url`, `thumb`, `caption` |
|
|
202
|
+
| [`youtube()`](#youtube--video-or-mp3) | `url`, `filename`, `title`, `author`, `width`, `height`, `thumbnail` |
|
|
203
|
+
| [`youtube_telegram()`](#youtube_telegram--telegram-file_id) | `status`, `file_id`, `media_type`, `title`, `duration`, `size` |
|
|
204
|
+
| [`youtube_info()`](#youtube_info--full-metadata) | `title`, `author`, `duration`, `thumbnails`, `formats[]` |
|
|
205
|
+
| [`youtube_info_basic()`](#youtube_info_basic--light-metadata) | `title`, `author_name`, `author_url`, `thumbnail_url` |
|
|
206
|
+
| [`instagram_profile()`](#instagram_profile) | `user{}`, `counts{}`, `stories[]`, `highlights[]`, `posts[]` |
|
|
207
|
+
| [`shazam_recognize()`](#shazam_recognize) | `track.title`, `track.subtitle`, `track.images`, `track.url` |
|
|
208
|
+
| [`shazam_top()`](#shazam_top) | `country`, `chart`, `total_songs`, `songs[]` |
|
|
209
|
+
| [`music_search()`](#music_search) | `query`, `total_results`, `results[]` |
|
|
210
|
+
| [`info_balance()`](#info_balance--free) | `plan`, `credits_remaining`, `limits{}`, `subscription{}` |
|
|
211
|
+
| [`api_keys_statistics()`](#api_keys_statistics--free) | `data[].statistics` — per period, per platform |
|
|
212
|
+
|
|
213
|
+
### `download()` — All-in-One downloader
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
media = api.download("https://www.instagram.com/reel/DPOi9V-CAqH/")
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"error": false,
|
|
222
|
+
"hosting": "instagram",
|
|
223
|
+
"shortcode": null,
|
|
224
|
+
"caption": "",
|
|
225
|
+
"type": "video",
|
|
226
|
+
"download_url": "https://scontent-iad3-1.cdninstagram.com/o1/v/t2/f2/m86/AQOua1uN….mp4?…",
|
|
227
|
+
"thumb": "https://scontent-iad6-1.cdninstagram.com/v/t51.82787-15/557983269_….jpg?…"
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
| Field | Type | Meaning |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| `hosting` | string | Detected platform: `instagram`, `tiktok`, `facebook`, `twitter`… |
|
|
234
|
+
| `type` | string | `video` or `image` |
|
|
235
|
+
| `download_url` | string | Direct link to the media file (expires — save it right away) |
|
|
236
|
+
| `thumb` | string | Preview image |
|
|
237
|
+
| `caption` | string | Post text, when the platform provides it |
|
|
238
|
+
|
|
239
|
+
### `youtube()` — video or MP3
|
|
240
|
+
|
|
241
|
+
```python
|
|
242
|
+
video = api.youtube("https://youtu.be/OORSiK8ScTI", format="720")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"status": "tunnel",
|
|
248
|
+
"url": "https://…/tunnel/dd9999da-6d26-46ce-85d1-128f02138f84.mp4",
|
|
249
|
+
"filename": "Музыка для души Miyagi & Эндшпиль (Hajime Records) - TheNext (720p, h264).mp4",
|
|
250
|
+
"duration": null,
|
|
251
|
+
"width": 1280,
|
|
252
|
+
"height": 720,
|
|
253
|
+
"thumbnail": "https://i.ytimg.com/vi/OORSiK8ScTI/hqdefault.jpg",
|
|
254
|
+
"title": "Музыка для души | Miyagi & Эндшпиль (#music #miyagi) (Hajime Records)",
|
|
255
|
+
"author": "TheNext"
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
| Field | Type | Meaning |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| `url` | string | Direct link to the video (or audio for `format="mp3"`) — pass it to `api.save_file()` |
|
|
262
|
+
| `filename` | string | Suggested file name, with quality and codec |
|
|
263
|
+
| `width`, `height` | int | Actual resolution of the returned file |
|
|
264
|
+
| `title`, `author`, `thumbnail` | string | Video title, channel name, preview image |
|
|
265
|
+
|
|
266
|
+
### `youtube_telegram()` — Telegram `file_id`
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
res = api.youtube_telegram("https://youtu.be/OORSiK8ScTI", format="720", bot_username="@MyBot")
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"status": "success",
|
|
275
|
+
"youtube_id": "OORSiK8ScTI",
|
|
276
|
+
"youtube_url": "https://youtu.be/OORSiK8ScTI",
|
|
277
|
+
"title": "Музыка для души | Miyagi & Эндшпиль",
|
|
278
|
+
"author": "TheNext",
|
|
279
|
+
"thumbnail_url": "https://i.ytimg.com/vi/OORSiK8ScTI/hqdefault.jpg",
|
|
280
|
+
"format": "720",
|
|
281
|
+
"media_type": "video",
|
|
282
|
+
"size": 25948010,
|
|
283
|
+
"duration": 228,
|
|
284
|
+
"width": 1280,
|
|
285
|
+
"height": 720,
|
|
286
|
+
"bot_username": "@mybot",
|
|
287
|
+
"file_id": "BAACAgIAAxkBAAI…"
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
| Field | Type | Meaning |
|
|
292
|
+
|---|---|---|
|
|
293
|
+
| `status` | string | `success`, or `processing` while a new video is being prepared — then call again after `retry_after` seconds |
|
|
294
|
+
| `file_id` | string | Telegram file id valid for `bot_username` — reusable, store it |
|
|
295
|
+
| `media_type` | string | `video` → `sendVideo`, `audio` → `sendAudio` |
|
|
296
|
+
| `size` | int | File size in bytes |
|
|
297
|
+
| `duration` | int | Length in seconds |
|
|
298
|
+
|
|
299
|
+
### `youtube_info()` — full metadata
|
|
300
|
+
|
|
301
|
+
```python
|
|
302
|
+
info = api.youtube_info("https://youtu.be/bICMVAhktBE")
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"ok": true,
|
|
308
|
+
"video_id": "bICMVAhktBE",
|
|
309
|
+
"title": "Shohjahon Jo'rayev - Farishtaginam (7-studiya ko'rsatuvida)",
|
|
310
|
+
"author": "JO'RAYEVLAR",
|
|
311
|
+
"author_url": "https://www.youtube.com/channel/UCEmb9urJ-ad8p-mdtYfOJIA",
|
|
312
|
+
"thumbnail": "https://i.ytimg.com/vi/bICMVAhktBE/maxresdefault.jpg",
|
|
313
|
+
"duration": 299,
|
|
314
|
+
"thumbnails": {
|
|
315
|
+
"low": "https://i.ytimg.com/vi/bICMVAhktBE/mqdefault.jpg",
|
|
316
|
+
"max": "https://i.ytimg.com/vi/bICMVAhktBE/maxresdefault.jpg"
|
|
317
|
+
},
|
|
318
|
+
"formats": [
|
|
319
|
+
{ "type": "video", "format": "144p", "filesize": 7390784 },
|
|
320
|
+
{ "type": "video", "format": "240p", "filesize": 8901511 }
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
`formats` lists every quality the video has, with its size in bytes — check it before asking `youtube()` for `1440` or `2160`.
|
|
326
|
+
|
|
327
|
+
### `youtube_info_basic()` — light metadata
|
|
328
|
+
|
|
329
|
+
```python
|
|
330
|
+
info = api.youtube_info_basic("https://youtu.be/bICMVAhktBE")
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
```json
|
|
334
|
+
{
|
|
335
|
+
"title": "Shohjahon Jo'rayev - Farishtaginam (7-studiya ko'rsatuvida)",
|
|
336
|
+
"author_name": "JO'RAYEVLAR",
|
|
337
|
+
"author_url": "https://www.youtube.com/@jorayevlar2790",
|
|
338
|
+
"type": "video",
|
|
339
|
+
"provider_name": "YouTube",
|
|
340
|
+
"thumbnail_url": "https://i.ytimg.com/vi/bICMVAhktBE/hqdefault.jpg",
|
|
341
|
+
"thumbnail_width": 480,
|
|
342
|
+
"thumbnail_height": 360,
|
|
343
|
+
"html": "<iframe width=\"200\" height=\"113\" src=\"https://www.youtube.com/embed/bICMVAhktBE?feature=oembed\" …></iframe>"
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### `instagram_profile()`
|
|
348
|
+
|
|
349
|
+
```python
|
|
350
|
+
profile = api.instagram_profile("cristiano")
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"error": false,
|
|
356
|
+
"user": {
|
|
357
|
+
"id": 173560420,
|
|
358
|
+
"username": "cristiano",
|
|
359
|
+
"full_name": "Cristiano Ronaldo",
|
|
360
|
+
"biography": "",
|
|
361
|
+
"external_url": "https://hrbl.me/CR7Pro2col",
|
|
362
|
+
"is_private": false,
|
|
363
|
+
"is_verified": true,
|
|
364
|
+
"profile_pic_url": "https://…/profile.jpg",
|
|
365
|
+
"stats": { "posts": 4121, "followers": 679697682, "following": 634 }
|
|
366
|
+
},
|
|
367
|
+
"counts": { "stories": 0, "highlights": 0, "posts": 12 },
|
|
368
|
+
"stories": [],
|
|
369
|
+
"highlights": [],
|
|
370
|
+
"posts": [
|
|
371
|
+
{ "id": "3968787288363683029_173560420", "type": "carousel", "url": "https://…/post.jpg", "taken_at": "2 days" }
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### `shazam_recognize()`
|
|
377
|
+
|
|
378
|
+
```python
|
|
379
|
+
song = api.shazam_recognize("https://example.com/clip.mp3")
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
```json
|
|
383
|
+
{
|
|
384
|
+
"matches": [{ "id": "804915529", "offset": 2.67, "timeskew": 0.0165, "frequencyskew": 0.0028 }],
|
|
385
|
+
"track": {
|
|
386
|
+
"key": "804915529",
|
|
387
|
+
"type": "MUSIC",
|
|
388
|
+
"title": "Nowy dzień",
|
|
389
|
+
"subtitle": "YOTAGAMI",
|
|
390
|
+
"images": {
|
|
391
|
+
"coverart": "https://is1-ssl.mzstatic.com/image/thumb/Music221/…/400x400cc.jpg",
|
|
392
|
+
"coverarthq": "https://is1-ssl.mzstatic.com/image/thumb/Music221/…/400x400cc.jpg"
|
|
393
|
+
},
|
|
394
|
+
"share": { "subject": "Nowy dzień - YOTAGAMI", "href": "https://www.shazam.com/track/804915529/…" },
|
|
395
|
+
"hub": { "type": "APPLEMUSIC", "providers": [{ "type": "SPOTIFY", "caption": "Open in Spotify" }] },
|
|
396
|
+
"genres": { "primary": "Dance" },
|
|
397
|
+
"url": "https://www.shazam.com/track/804915529/…"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
`track.title` is the song and `track.subtitle` the artist. When nothing is recognised, `matches` is empty and there is no `track` — use `song.get("track")`.
|
|
403
|
+
|
|
404
|
+
### `shazam_top()`
|
|
405
|
+
|
|
406
|
+
```python
|
|
407
|
+
top = api.shazam_top("united-states")
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
```json
|
|
411
|
+
{
|
|
412
|
+
"status": "success",
|
|
413
|
+
"country": "United States",
|
|
414
|
+
"country_code": "US",
|
|
415
|
+
"chart": "Top 200 United States",
|
|
416
|
+
"total_songs": 400,
|
|
417
|
+
"songs": [
|
|
418
|
+
{ "position": 1, "title": "Loser", "artist": "Tame Impala" }
|
|
419
|
+
]
|
|
420
|
+
}
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### `music_search()`
|
|
424
|
+
|
|
425
|
+
```python
|
|
426
|
+
found = api.music_search("Hello Adele", limit=5)
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
```json
|
|
430
|
+
{
|
|
431
|
+
"query": "Hello Adele",
|
|
432
|
+
"total_results": 5,
|
|
433
|
+
"results": [
|
|
434
|
+
{
|
|
435
|
+
"id": "YQHsXMglC9A",
|
|
436
|
+
"title": "Adele - Hello (Official Music Video)",
|
|
437
|
+
"artist": "Adele",
|
|
438
|
+
"duration": "6:07",
|
|
439
|
+
"thumbnail": "https://i.ytimg.com/vi/YQHsXMglC9A/mqdefault.jpg",
|
|
440
|
+
"year": ""
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
`id` is a YouTube video id — `api.youtube(f"https://youtu.be/{item['id']}", format="mp3")` turns a search hit into an audio file.
|
|
447
|
+
|
|
448
|
+
### `info_balance()` — free
|
|
449
|
+
|
|
450
|
+
```python
|
|
451
|
+
me = api.info_balance()
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
```json
|
|
455
|
+
{
|
|
456
|
+
"success": true,
|
|
457
|
+
"owner": "you@example.com",
|
|
458
|
+
"plan": { "name": "Pro" },
|
|
459
|
+
"credits_total": 100000,
|
|
460
|
+
"credits_remaining": 87350,
|
|
461
|
+
"credits_used": 12650,
|
|
462
|
+
"credits_used_percent": 12.7,
|
|
463
|
+
"limits": { "requests_per_second": 10, "requests_per_hour": 0, "requests_per_day": 0 },
|
|
464
|
+
"subscription": {
|
|
465
|
+
"purchased_at": "2026-11-01T09:00:00.000Z",
|
|
466
|
+
"expires_at": "2026-12-01T09:00:00.000Z",
|
|
467
|
+
"days_remaining": 7
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
A limit of `0` means unlimited. The answer is cached for up to 10 minutes.
|
|
473
|
+
|
|
474
|
+
### `api_keys_statistics()` — free
|
|
475
|
+
|
|
476
|
+
```python
|
|
477
|
+
stats = api.api_keys_statistics()
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
```json
|
|
481
|
+
{
|
|
482
|
+
"success": true,
|
|
483
|
+
"data": [
|
|
484
|
+
{
|
|
485
|
+
"apiKeyId": "cm…",
|
|
486
|
+
"apiKeyName": "Production",
|
|
487
|
+
"apiKey": "abcd1234efgh5678ijkl...",
|
|
488
|
+
"createdAt": "2026-09-01T10:00:00.000Z",
|
|
489
|
+
"statistics": {
|
|
490
|
+
"timePeriod": { "hourly": 42, "daily": 910, "weekly": 6120, "monthly": 25400, "total": 181300 },
|
|
491
|
+
"requests": { "success": 178900, "failed": 2400, "successRate": 98.7 },
|
|
492
|
+
"platforms": {
|
|
493
|
+
"YouTube": { "total": 90500, "success": 89600, "failed": 900, "hourly": 20, "daily": 450, "weekly": 3000, "monthly": 12600, "successRate": 99.0 },
|
|
494
|
+
"Instagram": { "total": 60100, "success": 59200, "failed": 900, "hourly": 15, "daily": 300, "weekly": 2100, "monthly": 8400, "successRate": 98.5 }
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
],
|
|
499
|
+
"cached": false,
|
|
500
|
+
"computedAt": "2026-11-24T05:00:00.000Z"
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
Statistics are cached for up to an hour. The two account samples above use illustrative numbers.
|
|
505
|
+
|
|
506
|
+
### `nsfw_scan()`
|
|
507
|
+
|
|
508
|
+
```python
|
|
509
|
+
verdict = api.nsfw_scan("https://example.com/image.jpg")
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Returns the scanner's verdict for the image or video as JSON; the live sample is in the [API docs](https://saverapi.net/docs).
|
|
513
|
+
|
|
514
|
+
### Errors
|
|
515
|
+
|
|
516
|
+
A failed call raises an exception (see [Errors and retries](#errors-and-retries)); the API's JSON body is kept on it:
|
|
517
|
+
|
|
518
|
+
```python
|
|
519
|
+
try:
|
|
520
|
+
api.download("https://www.instagram.com/p/private/")
|
|
521
|
+
except SaverAPIError as exc:
|
|
522
|
+
print(exc.status_code) # e.g. 400
|
|
523
|
+
print(exc.message) # "…"
|
|
524
|
+
print(exc.payload) # {"message": "…"}
|
|
525
|
+
```
|
|
526
|
+
|
|
191
527
|
## Async (aiogram, FastAPI, asyncio)
|
|
192
528
|
|
|
193
529
|
```python
|
|
@@ -314,6 +650,8 @@ Yes: `pip install "saverapi-client[async]"` and use `AsyncSaverAPI` — same met
|
|
|
314
650
|
- Shazam Song Recognition API: https://saverapi.net/shazam-api
|
|
315
651
|
- Social Media Downloader API: https://saverapi.net/social-media-downloader-api
|
|
316
652
|
- All-in-One Downloader API: https://saverapi.net/all-in-one-downloader-api
|
|
653
|
+
- Source code and issues: https://github.com/saverapinet/saverapi-python
|
|
654
|
+
- Open-source Telegram downloader bot built on this API: https://github.com/saverapinet/saverapi-telegram-bot
|
|
317
655
|
- Tutorials: https://saverapi.net/blog
|
|
318
656
|
- [YouTube downloader API in Python](https://saverapi.net/blog/youtube-downloader-api-python)
|
|
319
657
|
- [Build a Telegram YouTube downloader bot](https://saverapi.net/blog/build-telegram-youtube-downloader-bot)
|
|
@@ -324,6 +662,12 @@ Yes: `pip install "saverapi-client[async]"` and use `AsyncSaverAPI` — same met
|
|
|
324
662
|
|
|
325
663
|
## Changelog
|
|
326
664
|
|
|
665
|
+
**2.0.2**
|
|
666
|
+
- The SDK source is now public on GitHub: [saverapinet/saverapi-python](https://github.com/saverapinet/saverapi-python) — source and issue tracker linked from the package. No code changes.
|
|
667
|
+
|
|
668
|
+
**2.0.1**
|
|
669
|
+
- Documentation: new **Response reference** — a real JSON sample and key-field table for every method. No code changes.
|
|
670
|
+
|
|
327
671
|
**2.0.0**
|
|
328
672
|
- YouTube: `api.youtube()` now documents the new `2160` (4K) and `1440` (2K) formats; the full list is exported as `YOUTUBE_FORMATS`.
|
|
329
673
|
- YouTube for Telegram: `api.youtube_telegram(url, format, bot_username="@MyBot")` returns a ready `file_id` for your bot. New CLI command `saverapi youtube-telegram URL --bot @MyBot`.
|
|
@@ -9,6 +9,7 @@ Official client for **[SaverAPI.NET](https://saverapi.net)**: download videos, R
|
|
|
9
9
|
[](https://pypi.org/project/saverapi-client/)
|
|
10
10
|
[](https://pypi.org/project/saverapi-client/)
|
|
11
11
|
[](#license)
|
|
12
|
+
[](https://github.com/saverapinet/saverapi-python/actions/workflows/tests.yml)
|
|
12
13
|
[](https://pypi.org/project/saverapi-client/)
|
|
13
14
|
[](https://saverapi.net/docs)
|
|
14
15
|
[](https://t.me/SaverAPI)
|
|
@@ -28,9 +29,10 @@ Get a free API key at **[saverapi.net](https://saverapi.net/auth/register)** —
|
|
|
28
29
|
- **YouTube from 144p to 4K** — `2160`, `1440`, `1080`, `720`… or `mp3` audio, with no yt-dlp, ffmpeg, proxies or cookies to maintain.
|
|
29
30
|
- **Built for Telegram bots** — get a ready `file_id` for your own bot and send a YouTube video instantly, without downloading or re-uploading it.
|
|
30
31
|
- **Sync, async and CLI** — `SaverAPI` (requests), `AsyncSaverAPI` (httpx, for aiogram / FastAPI) and a `saverapi` terminal command.
|
|
32
|
+
- **Documented responses** — a real JSON sample and field table for every method, [right here](#response-reference).
|
|
31
33
|
- **Production ready** — automatic retries, typed exceptions, type hints, Python 3.8–3.13.
|
|
32
34
|
|
|
33
|
-
**Contents:** [Quick start](#quick-start) · [Supported platforms](#supported-platforms) · [Examples](#examples) · [Async](#async-aiogram-fastapi-asyncio) · [Command line](#command-line) · [Errors and retries](#errors-and-retries) · [FAQ](#faq) · [Changelog](#changelog)
|
|
35
|
+
**Contents:** [Quick start](#quick-start) · [Supported platforms](#supported-platforms) · [Examples](#examples) · [Response reference](#response-reference) · [Async](#async-aiogram-fastapi-asyncio) · [Command line](#command-line) · [Errors and retries](#errors-and-retries) · [FAQ](#faq) · [Changelog](#changelog)
|
|
34
36
|
|
|
35
37
|
---
|
|
36
38
|
|
|
@@ -69,7 +71,7 @@ One call, one parameter: the **All-in-One downloader** recognises the platform f
|
|
|
69
71
|
| Account balance (free) | `api.info_balance()` | `/infobalans` |
|
|
70
72
|
| Key statistics (free) | `api.api_keys_statistics()` | `/api-keys/all-statistics` |
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
What each method returns: **[Response reference](#response-reference)** below. Live parameter reference: **[saverapi.net/docs](https://saverapi.net/docs)**. Endpoints added to the catalog later can be called with `api.request("/endpoint-path", {"param": "value"})`.
|
|
73
75
|
|
|
74
76
|
## Examples
|
|
75
77
|
|
|
@@ -143,6 +145,338 @@ top = api.shazam_top("united-states")
|
|
|
143
145
|
print(api.info_balance())
|
|
144
146
|
```
|
|
145
147
|
|
|
148
|
+
## Response reference
|
|
149
|
+
|
|
150
|
+
Every method returns the API's JSON decoded into a plain `dict`. The samples below are real responses (long URLs and lists shortened with `…`). Fields can be `null` when the source has no value, so prefer `.get()` for optional ones.
|
|
151
|
+
|
|
152
|
+
| Method | Key fields in the response |
|
|
153
|
+
|---|---|
|
|
154
|
+
| [`download()`](#download--all-in-one-downloader) | `hosting`, `type`, `download_url`, `thumb`, `caption` |
|
|
155
|
+
| [`youtube()`](#youtube--video-or-mp3) | `url`, `filename`, `title`, `author`, `width`, `height`, `thumbnail` |
|
|
156
|
+
| [`youtube_telegram()`](#youtube_telegram--telegram-file_id) | `status`, `file_id`, `media_type`, `title`, `duration`, `size` |
|
|
157
|
+
| [`youtube_info()`](#youtube_info--full-metadata) | `title`, `author`, `duration`, `thumbnails`, `formats[]` |
|
|
158
|
+
| [`youtube_info_basic()`](#youtube_info_basic--light-metadata) | `title`, `author_name`, `author_url`, `thumbnail_url` |
|
|
159
|
+
| [`instagram_profile()`](#instagram_profile) | `user{}`, `counts{}`, `stories[]`, `highlights[]`, `posts[]` |
|
|
160
|
+
| [`shazam_recognize()`](#shazam_recognize) | `track.title`, `track.subtitle`, `track.images`, `track.url` |
|
|
161
|
+
| [`shazam_top()`](#shazam_top) | `country`, `chart`, `total_songs`, `songs[]` |
|
|
162
|
+
| [`music_search()`](#music_search) | `query`, `total_results`, `results[]` |
|
|
163
|
+
| [`info_balance()`](#info_balance--free) | `plan`, `credits_remaining`, `limits{}`, `subscription{}` |
|
|
164
|
+
| [`api_keys_statistics()`](#api_keys_statistics--free) | `data[].statistics` — per period, per platform |
|
|
165
|
+
|
|
166
|
+
### `download()` — All-in-One downloader
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
media = api.download("https://www.instagram.com/reel/DPOi9V-CAqH/")
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"error": false,
|
|
175
|
+
"hosting": "instagram",
|
|
176
|
+
"shortcode": null,
|
|
177
|
+
"caption": "",
|
|
178
|
+
"type": "video",
|
|
179
|
+
"download_url": "https://scontent-iad3-1.cdninstagram.com/o1/v/t2/f2/m86/AQOua1uN….mp4?…",
|
|
180
|
+
"thumb": "https://scontent-iad6-1.cdninstagram.com/v/t51.82787-15/557983269_….jpg?…"
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
| Field | Type | Meaning |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| `hosting` | string | Detected platform: `instagram`, `tiktok`, `facebook`, `twitter`… |
|
|
187
|
+
| `type` | string | `video` or `image` |
|
|
188
|
+
| `download_url` | string | Direct link to the media file (expires — save it right away) |
|
|
189
|
+
| `thumb` | string | Preview image |
|
|
190
|
+
| `caption` | string | Post text, when the platform provides it |
|
|
191
|
+
|
|
192
|
+
### `youtube()` — video or MP3
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
video = api.youtube("https://youtu.be/OORSiK8ScTI", format="720")
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"status": "tunnel",
|
|
201
|
+
"url": "https://…/tunnel/dd9999da-6d26-46ce-85d1-128f02138f84.mp4",
|
|
202
|
+
"filename": "Музыка для души Miyagi & Эндшпиль (Hajime Records) - TheNext (720p, h264).mp4",
|
|
203
|
+
"duration": null,
|
|
204
|
+
"width": 1280,
|
|
205
|
+
"height": 720,
|
|
206
|
+
"thumbnail": "https://i.ytimg.com/vi/OORSiK8ScTI/hqdefault.jpg",
|
|
207
|
+
"title": "Музыка для души | Miyagi & Эндшпиль (#music #miyagi) (Hajime Records)",
|
|
208
|
+
"author": "TheNext"
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
| Field | Type | Meaning |
|
|
213
|
+
|---|---|---|
|
|
214
|
+
| `url` | string | Direct link to the video (or audio for `format="mp3"`) — pass it to `api.save_file()` |
|
|
215
|
+
| `filename` | string | Suggested file name, with quality and codec |
|
|
216
|
+
| `width`, `height` | int | Actual resolution of the returned file |
|
|
217
|
+
| `title`, `author`, `thumbnail` | string | Video title, channel name, preview image |
|
|
218
|
+
|
|
219
|
+
### `youtube_telegram()` — Telegram `file_id`
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
res = api.youtube_telegram("https://youtu.be/OORSiK8ScTI", format="720", bot_username="@MyBot")
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"status": "success",
|
|
228
|
+
"youtube_id": "OORSiK8ScTI",
|
|
229
|
+
"youtube_url": "https://youtu.be/OORSiK8ScTI",
|
|
230
|
+
"title": "Музыка для души | Miyagi & Эндшпиль",
|
|
231
|
+
"author": "TheNext",
|
|
232
|
+
"thumbnail_url": "https://i.ytimg.com/vi/OORSiK8ScTI/hqdefault.jpg",
|
|
233
|
+
"format": "720",
|
|
234
|
+
"media_type": "video",
|
|
235
|
+
"size": 25948010,
|
|
236
|
+
"duration": 228,
|
|
237
|
+
"width": 1280,
|
|
238
|
+
"height": 720,
|
|
239
|
+
"bot_username": "@mybot",
|
|
240
|
+
"file_id": "BAACAgIAAxkBAAI…"
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
| Field | Type | Meaning |
|
|
245
|
+
|---|---|---|
|
|
246
|
+
| `status` | string | `success`, or `processing` while a new video is being prepared — then call again after `retry_after` seconds |
|
|
247
|
+
| `file_id` | string | Telegram file id valid for `bot_username` — reusable, store it |
|
|
248
|
+
| `media_type` | string | `video` → `sendVideo`, `audio` → `sendAudio` |
|
|
249
|
+
| `size` | int | File size in bytes |
|
|
250
|
+
| `duration` | int | Length in seconds |
|
|
251
|
+
|
|
252
|
+
### `youtube_info()` — full metadata
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
info = api.youtube_info("https://youtu.be/bICMVAhktBE")
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"ok": true,
|
|
261
|
+
"video_id": "bICMVAhktBE",
|
|
262
|
+
"title": "Shohjahon Jo'rayev - Farishtaginam (7-studiya ko'rsatuvida)",
|
|
263
|
+
"author": "JO'RAYEVLAR",
|
|
264
|
+
"author_url": "https://www.youtube.com/channel/UCEmb9urJ-ad8p-mdtYfOJIA",
|
|
265
|
+
"thumbnail": "https://i.ytimg.com/vi/bICMVAhktBE/maxresdefault.jpg",
|
|
266
|
+
"duration": 299,
|
|
267
|
+
"thumbnails": {
|
|
268
|
+
"low": "https://i.ytimg.com/vi/bICMVAhktBE/mqdefault.jpg",
|
|
269
|
+
"max": "https://i.ytimg.com/vi/bICMVAhktBE/maxresdefault.jpg"
|
|
270
|
+
},
|
|
271
|
+
"formats": [
|
|
272
|
+
{ "type": "video", "format": "144p", "filesize": 7390784 },
|
|
273
|
+
{ "type": "video", "format": "240p", "filesize": 8901511 }
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
`formats` lists every quality the video has, with its size in bytes — check it before asking `youtube()` for `1440` or `2160`.
|
|
279
|
+
|
|
280
|
+
### `youtube_info_basic()` — light metadata
|
|
281
|
+
|
|
282
|
+
```python
|
|
283
|
+
info = api.youtube_info_basic("https://youtu.be/bICMVAhktBE")
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"title": "Shohjahon Jo'rayev - Farishtaginam (7-studiya ko'rsatuvida)",
|
|
289
|
+
"author_name": "JO'RAYEVLAR",
|
|
290
|
+
"author_url": "https://www.youtube.com/@jorayevlar2790",
|
|
291
|
+
"type": "video",
|
|
292
|
+
"provider_name": "YouTube",
|
|
293
|
+
"thumbnail_url": "https://i.ytimg.com/vi/bICMVAhktBE/hqdefault.jpg",
|
|
294
|
+
"thumbnail_width": 480,
|
|
295
|
+
"thumbnail_height": 360,
|
|
296
|
+
"html": "<iframe width=\"200\" height=\"113\" src=\"https://www.youtube.com/embed/bICMVAhktBE?feature=oembed\" …></iframe>"
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### `instagram_profile()`
|
|
301
|
+
|
|
302
|
+
```python
|
|
303
|
+
profile = api.instagram_profile("cristiano")
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
```json
|
|
307
|
+
{
|
|
308
|
+
"error": false,
|
|
309
|
+
"user": {
|
|
310
|
+
"id": 173560420,
|
|
311
|
+
"username": "cristiano",
|
|
312
|
+
"full_name": "Cristiano Ronaldo",
|
|
313
|
+
"biography": "",
|
|
314
|
+
"external_url": "https://hrbl.me/CR7Pro2col",
|
|
315
|
+
"is_private": false,
|
|
316
|
+
"is_verified": true,
|
|
317
|
+
"profile_pic_url": "https://…/profile.jpg",
|
|
318
|
+
"stats": { "posts": 4121, "followers": 679697682, "following": 634 }
|
|
319
|
+
},
|
|
320
|
+
"counts": { "stories": 0, "highlights": 0, "posts": 12 },
|
|
321
|
+
"stories": [],
|
|
322
|
+
"highlights": [],
|
|
323
|
+
"posts": [
|
|
324
|
+
{ "id": "3968787288363683029_173560420", "type": "carousel", "url": "https://…/post.jpg", "taken_at": "2 days" }
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### `shazam_recognize()`
|
|
330
|
+
|
|
331
|
+
```python
|
|
332
|
+
song = api.shazam_recognize("https://example.com/clip.mp3")
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
{
|
|
337
|
+
"matches": [{ "id": "804915529", "offset": 2.67, "timeskew": 0.0165, "frequencyskew": 0.0028 }],
|
|
338
|
+
"track": {
|
|
339
|
+
"key": "804915529",
|
|
340
|
+
"type": "MUSIC",
|
|
341
|
+
"title": "Nowy dzień",
|
|
342
|
+
"subtitle": "YOTAGAMI",
|
|
343
|
+
"images": {
|
|
344
|
+
"coverart": "https://is1-ssl.mzstatic.com/image/thumb/Music221/…/400x400cc.jpg",
|
|
345
|
+
"coverarthq": "https://is1-ssl.mzstatic.com/image/thumb/Music221/…/400x400cc.jpg"
|
|
346
|
+
},
|
|
347
|
+
"share": { "subject": "Nowy dzień - YOTAGAMI", "href": "https://www.shazam.com/track/804915529/…" },
|
|
348
|
+
"hub": { "type": "APPLEMUSIC", "providers": [{ "type": "SPOTIFY", "caption": "Open in Spotify" }] },
|
|
349
|
+
"genres": { "primary": "Dance" },
|
|
350
|
+
"url": "https://www.shazam.com/track/804915529/…"
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
`track.title` is the song and `track.subtitle` the artist. When nothing is recognised, `matches` is empty and there is no `track` — use `song.get("track")`.
|
|
356
|
+
|
|
357
|
+
### `shazam_top()`
|
|
358
|
+
|
|
359
|
+
```python
|
|
360
|
+
top = api.shazam_top("united-states")
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
```json
|
|
364
|
+
{
|
|
365
|
+
"status": "success",
|
|
366
|
+
"country": "United States",
|
|
367
|
+
"country_code": "US",
|
|
368
|
+
"chart": "Top 200 United States",
|
|
369
|
+
"total_songs": 400,
|
|
370
|
+
"songs": [
|
|
371
|
+
{ "position": 1, "title": "Loser", "artist": "Tame Impala" }
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### `music_search()`
|
|
377
|
+
|
|
378
|
+
```python
|
|
379
|
+
found = api.music_search("Hello Adele", limit=5)
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
```json
|
|
383
|
+
{
|
|
384
|
+
"query": "Hello Adele",
|
|
385
|
+
"total_results": 5,
|
|
386
|
+
"results": [
|
|
387
|
+
{
|
|
388
|
+
"id": "YQHsXMglC9A",
|
|
389
|
+
"title": "Adele - Hello (Official Music Video)",
|
|
390
|
+
"artist": "Adele",
|
|
391
|
+
"duration": "6:07",
|
|
392
|
+
"thumbnail": "https://i.ytimg.com/vi/YQHsXMglC9A/mqdefault.jpg",
|
|
393
|
+
"year": ""
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
`id` is a YouTube video id — `api.youtube(f"https://youtu.be/{item['id']}", format="mp3")` turns a search hit into an audio file.
|
|
400
|
+
|
|
401
|
+
### `info_balance()` — free
|
|
402
|
+
|
|
403
|
+
```python
|
|
404
|
+
me = api.info_balance()
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
```json
|
|
408
|
+
{
|
|
409
|
+
"success": true,
|
|
410
|
+
"owner": "you@example.com",
|
|
411
|
+
"plan": { "name": "Pro" },
|
|
412
|
+
"credits_total": 100000,
|
|
413
|
+
"credits_remaining": 87350,
|
|
414
|
+
"credits_used": 12650,
|
|
415
|
+
"credits_used_percent": 12.7,
|
|
416
|
+
"limits": { "requests_per_second": 10, "requests_per_hour": 0, "requests_per_day": 0 },
|
|
417
|
+
"subscription": {
|
|
418
|
+
"purchased_at": "2026-11-01T09:00:00.000Z",
|
|
419
|
+
"expires_at": "2026-12-01T09:00:00.000Z",
|
|
420
|
+
"days_remaining": 7
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
A limit of `0` means unlimited. The answer is cached for up to 10 minutes.
|
|
426
|
+
|
|
427
|
+
### `api_keys_statistics()` — free
|
|
428
|
+
|
|
429
|
+
```python
|
|
430
|
+
stats = api.api_keys_statistics()
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
```json
|
|
434
|
+
{
|
|
435
|
+
"success": true,
|
|
436
|
+
"data": [
|
|
437
|
+
{
|
|
438
|
+
"apiKeyId": "cm…",
|
|
439
|
+
"apiKeyName": "Production",
|
|
440
|
+
"apiKey": "abcd1234efgh5678ijkl...",
|
|
441
|
+
"createdAt": "2026-09-01T10:00:00.000Z",
|
|
442
|
+
"statistics": {
|
|
443
|
+
"timePeriod": { "hourly": 42, "daily": 910, "weekly": 6120, "monthly": 25400, "total": 181300 },
|
|
444
|
+
"requests": { "success": 178900, "failed": 2400, "successRate": 98.7 },
|
|
445
|
+
"platforms": {
|
|
446
|
+
"YouTube": { "total": 90500, "success": 89600, "failed": 900, "hourly": 20, "daily": 450, "weekly": 3000, "monthly": 12600, "successRate": 99.0 },
|
|
447
|
+
"Instagram": { "total": 60100, "success": 59200, "failed": 900, "hourly": 15, "daily": 300, "weekly": 2100, "monthly": 8400, "successRate": 98.5 }
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
],
|
|
452
|
+
"cached": false,
|
|
453
|
+
"computedAt": "2026-11-24T05:00:00.000Z"
|
|
454
|
+
}
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
Statistics are cached for up to an hour. The two account samples above use illustrative numbers.
|
|
458
|
+
|
|
459
|
+
### `nsfw_scan()`
|
|
460
|
+
|
|
461
|
+
```python
|
|
462
|
+
verdict = api.nsfw_scan("https://example.com/image.jpg")
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
Returns the scanner's verdict for the image or video as JSON; the live sample is in the [API docs](https://saverapi.net/docs).
|
|
466
|
+
|
|
467
|
+
### Errors
|
|
468
|
+
|
|
469
|
+
A failed call raises an exception (see [Errors and retries](#errors-and-retries)); the API's JSON body is kept on it:
|
|
470
|
+
|
|
471
|
+
```python
|
|
472
|
+
try:
|
|
473
|
+
api.download("https://www.instagram.com/p/private/")
|
|
474
|
+
except SaverAPIError as exc:
|
|
475
|
+
print(exc.status_code) # e.g. 400
|
|
476
|
+
print(exc.message) # "…"
|
|
477
|
+
print(exc.payload) # {"message": "…"}
|
|
478
|
+
```
|
|
479
|
+
|
|
146
480
|
## Async (aiogram, FastAPI, asyncio)
|
|
147
481
|
|
|
148
482
|
```python
|
|
@@ -269,6 +603,8 @@ Yes: `pip install "saverapi-client[async]"` and use `AsyncSaverAPI` — same met
|
|
|
269
603
|
- Shazam Song Recognition API: https://saverapi.net/shazam-api
|
|
270
604
|
- Social Media Downloader API: https://saverapi.net/social-media-downloader-api
|
|
271
605
|
- All-in-One Downloader API: https://saverapi.net/all-in-one-downloader-api
|
|
606
|
+
- Source code and issues: https://github.com/saverapinet/saverapi-python
|
|
607
|
+
- Open-source Telegram downloader bot built on this API: https://github.com/saverapinet/saverapi-telegram-bot
|
|
272
608
|
- Tutorials: https://saverapi.net/blog
|
|
273
609
|
- [YouTube downloader API in Python](https://saverapi.net/blog/youtube-downloader-api-python)
|
|
274
610
|
- [Build a Telegram YouTube downloader bot](https://saverapi.net/blog/build-telegram-youtube-downloader-bot)
|
|
@@ -279,6 +615,12 @@ Yes: `pip install "saverapi-client[async]"` and use `AsyncSaverAPI` — same met
|
|
|
279
615
|
|
|
280
616
|
## Changelog
|
|
281
617
|
|
|
618
|
+
**2.0.2**
|
|
619
|
+
- The SDK source is now public on GitHub: [saverapinet/saverapi-python](https://github.com/saverapinet/saverapi-python) — source and issue tracker linked from the package. No code changes.
|
|
620
|
+
|
|
621
|
+
**2.0.1**
|
|
622
|
+
- Documentation: new **Response reference** — a real JSON sample and key-field table for every method. No code changes.
|
|
623
|
+
|
|
282
624
|
**2.0.0**
|
|
283
625
|
- YouTube: `api.youtube()` now documents the new `2160` (4K) and `1440` (2K) formats; the full list is exported as `YOUTUBE_FORMATS`.
|
|
284
626
|
- YouTube for Telegram: `api.youtube_telegram(url, format, bot_username="@MyBot")` returns a ready `file_id` for your bot. New CLI command `saverapi youtube-telegram URL --bot @MyBot`.
|
|
@@ -53,6 +53,8 @@ saverapi = "saverapi.cli:main"
|
|
|
53
53
|
[project.urls]
|
|
54
54
|
Homepage = "https://saverapi.net"
|
|
55
55
|
Documentation = "https://saverapi.net/docs"
|
|
56
|
+
Source = "https://github.com/saverapinet/saverapi-python"
|
|
57
|
+
Issues = "https://github.com/saverapinet/saverapi-python/issues"
|
|
56
58
|
"API catalog" = "https://saverapi.net/all-in-one-downloader-api"
|
|
57
59
|
"YouTube Downloader API" = "https://saverapi.net/youtube-downloader-api"
|
|
58
60
|
"Instagram Downloader API" = "https://saverapi.net/instagram-downloader-api"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.2"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: saverapi-client
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: Official Python SDK for SaverAPI.NET — video downloader API for YouTube (4K, MP3), Instagram, TikTok, Facebook, X, Pinterest and Threads, Telegram bot file_id, Shazam, music search, NSFW scan. Sync, async, CLI.
|
|
5
5
|
Author-email: "SaverAPI.NET" <saverapinet@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://saverapi.net
|
|
8
8
|
Project-URL: Documentation, https://saverapi.net/docs
|
|
9
|
+
Project-URL: Source, https://github.com/saverapinet/saverapi-python
|
|
10
|
+
Project-URL: Issues, https://github.com/saverapinet/saverapi-python/issues
|
|
9
11
|
Project-URL: API catalog, https://saverapi.net/all-in-one-downloader-api
|
|
10
12
|
Project-URL: YouTube Downloader API, https://saverapi.net/youtube-downloader-api
|
|
11
13
|
Project-URL: Instagram Downloader API, https://saverapi.net/instagram-downloader-api
|
|
@@ -54,6 +56,7 @@ Official client for **[SaverAPI.NET](https://saverapi.net)**: download videos, R
|
|
|
54
56
|
[](https://pypi.org/project/saverapi-client/)
|
|
55
57
|
[](https://pypi.org/project/saverapi-client/)
|
|
56
58
|
[](#license)
|
|
59
|
+
[](https://github.com/saverapinet/saverapi-python/actions/workflows/tests.yml)
|
|
57
60
|
[](https://pypi.org/project/saverapi-client/)
|
|
58
61
|
[](https://saverapi.net/docs)
|
|
59
62
|
[](https://t.me/SaverAPI)
|
|
@@ -73,9 +76,10 @@ Get a free API key at **[saverapi.net](https://saverapi.net/auth/register)** —
|
|
|
73
76
|
- **YouTube from 144p to 4K** — `2160`, `1440`, `1080`, `720`… or `mp3` audio, with no yt-dlp, ffmpeg, proxies or cookies to maintain.
|
|
74
77
|
- **Built for Telegram bots** — get a ready `file_id` for your own bot and send a YouTube video instantly, without downloading or re-uploading it.
|
|
75
78
|
- **Sync, async and CLI** — `SaverAPI` (requests), `AsyncSaverAPI` (httpx, for aiogram / FastAPI) and a `saverapi` terminal command.
|
|
79
|
+
- **Documented responses** — a real JSON sample and field table for every method, [right here](#response-reference).
|
|
76
80
|
- **Production ready** — automatic retries, typed exceptions, type hints, Python 3.8–3.13.
|
|
77
81
|
|
|
78
|
-
**Contents:** [Quick start](#quick-start) · [Supported platforms](#supported-platforms) · [Examples](#examples) · [Async](#async-aiogram-fastapi-asyncio) · [Command line](#command-line) · [Errors and retries](#errors-and-retries) · [FAQ](#faq) · [Changelog](#changelog)
|
|
82
|
+
**Contents:** [Quick start](#quick-start) · [Supported platforms](#supported-platforms) · [Examples](#examples) · [Response reference](#response-reference) · [Async](#async-aiogram-fastapi-asyncio) · [Command line](#command-line) · [Errors and retries](#errors-and-retries) · [FAQ](#faq) · [Changelog](#changelog)
|
|
79
83
|
|
|
80
84
|
---
|
|
81
85
|
|
|
@@ -114,7 +118,7 @@ One call, one parameter: the **All-in-One downloader** recognises the platform f
|
|
|
114
118
|
| Account balance (free) | `api.info_balance()` | `/infobalans` |
|
|
115
119
|
| Key statistics (free) | `api.api_keys_statistics()` | `/api-keys/all-statistics` |
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
What each method returns: **[Response reference](#response-reference)** below. Live parameter reference: **[saverapi.net/docs](https://saverapi.net/docs)**. Endpoints added to the catalog later can be called with `api.request("/endpoint-path", {"param": "value"})`.
|
|
118
122
|
|
|
119
123
|
## Examples
|
|
120
124
|
|
|
@@ -188,6 +192,338 @@ top = api.shazam_top("united-states")
|
|
|
188
192
|
print(api.info_balance())
|
|
189
193
|
```
|
|
190
194
|
|
|
195
|
+
## Response reference
|
|
196
|
+
|
|
197
|
+
Every method returns the API's JSON decoded into a plain `dict`. The samples below are real responses (long URLs and lists shortened with `…`). Fields can be `null` when the source has no value, so prefer `.get()` for optional ones.
|
|
198
|
+
|
|
199
|
+
| Method | Key fields in the response |
|
|
200
|
+
|---|---|
|
|
201
|
+
| [`download()`](#download--all-in-one-downloader) | `hosting`, `type`, `download_url`, `thumb`, `caption` |
|
|
202
|
+
| [`youtube()`](#youtube--video-or-mp3) | `url`, `filename`, `title`, `author`, `width`, `height`, `thumbnail` |
|
|
203
|
+
| [`youtube_telegram()`](#youtube_telegram--telegram-file_id) | `status`, `file_id`, `media_type`, `title`, `duration`, `size` |
|
|
204
|
+
| [`youtube_info()`](#youtube_info--full-metadata) | `title`, `author`, `duration`, `thumbnails`, `formats[]` |
|
|
205
|
+
| [`youtube_info_basic()`](#youtube_info_basic--light-metadata) | `title`, `author_name`, `author_url`, `thumbnail_url` |
|
|
206
|
+
| [`instagram_profile()`](#instagram_profile) | `user{}`, `counts{}`, `stories[]`, `highlights[]`, `posts[]` |
|
|
207
|
+
| [`shazam_recognize()`](#shazam_recognize) | `track.title`, `track.subtitle`, `track.images`, `track.url` |
|
|
208
|
+
| [`shazam_top()`](#shazam_top) | `country`, `chart`, `total_songs`, `songs[]` |
|
|
209
|
+
| [`music_search()`](#music_search) | `query`, `total_results`, `results[]` |
|
|
210
|
+
| [`info_balance()`](#info_balance--free) | `plan`, `credits_remaining`, `limits{}`, `subscription{}` |
|
|
211
|
+
| [`api_keys_statistics()`](#api_keys_statistics--free) | `data[].statistics` — per period, per platform |
|
|
212
|
+
|
|
213
|
+
### `download()` — All-in-One downloader
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
media = api.download("https://www.instagram.com/reel/DPOi9V-CAqH/")
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"error": false,
|
|
222
|
+
"hosting": "instagram",
|
|
223
|
+
"shortcode": null,
|
|
224
|
+
"caption": "",
|
|
225
|
+
"type": "video",
|
|
226
|
+
"download_url": "https://scontent-iad3-1.cdninstagram.com/o1/v/t2/f2/m86/AQOua1uN….mp4?…",
|
|
227
|
+
"thumb": "https://scontent-iad6-1.cdninstagram.com/v/t51.82787-15/557983269_….jpg?…"
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
| Field | Type | Meaning |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| `hosting` | string | Detected platform: `instagram`, `tiktok`, `facebook`, `twitter`… |
|
|
234
|
+
| `type` | string | `video` or `image` |
|
|
235
|
+
| `download_url` | string | Direct link to the media file (expires — save it right away) |
|
|
236
|
+
| `thumb` | string | Preview image |
|
|
237
|
+
| `caption` | string | Post text, when the platform provides it |
|
|
238
|
+
|
|
239
|
+
### `youtube()` — video or MP3
|
|
240
|
+
|
|
241
|
+
```python
|
|
242
|
+
video = api.youtube("https://youtu.be/OORSiK8ScTI", format="720")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"status": "tunnel",
|
|
248
|
+
"url": "https://…/tunnel/dd9999da-6d26-46ce-85d1-128f02138f84.mp4",
|
|
249
|
+
"filename": "Музыка для души Miyagi & Эндшпиль (Hajime Records) - TheNext (720p, h264).mp4",
|
|
250
|
+
"duration": null,
|
|
251
|
+
"width": 1280,
|
|
252
|
+
"height": 720,
|
|
253
|
+
"thumbnail": "https://i.ytimg.com/vi/OORSiK8ScTI/hqdefault.jpg",
|
|
254
|
+
"title": "Музыка для души | Miyagi & Эндшпиль (#music #miyagi) (Hajime Records)",
|
|
255
|
+
"author": "TheNext"
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
| Field | Type | Meaning |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| `url` | string | Direct link to the video (or audio for `format="mp3"`) — pass it to `api.save_file()` |
|
|
262
|
+
| `filename` | string | Suggested file name, with quality and codec |
|
|
263
|
+
| `width`, `height` | int | Actual resolution of the returned file |
|
|
264
|
+
| `title`, `author`, `thumbnail` | string | Video title, channel name, preview image |
|
|
265
|
+
|
|
266
|
+
### `youtube_telegram()` — Telegram `file_id`
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
res = api.youtube_telegram("https://youtu.be/OORSiK8ScTI", format="720", bot_username="@MyBot")
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"status": "success",
|
|
275
|
+
"youtube_id": "OORSiK8ScTI",
|
|
276
|
+
"youtube_url": "https://youtu.be/OORSiK8ScTI",
|
|
277
|
+
"title": "Музыка для души | Miyagi & Эндшпиль",
|
|
278
|
+
"author": "TheNext",
|
|
279
|
+
"thumbnail_url": "https://i.ytimg.com/vi/OORSiK8ScTI/hqdefault.jpg",
|
|
280
|
+
"format": "720",
|
|
281
|
+
"media_type": "video",
|
|
282
|
+
"size": 25948010,
|
|
283
|
+
"duration": 228,
|
|
284
|
+
"width": 1280,
|
|
285
|
+
"height": 720,
|
|
286
|
+
"bot_username": "@mybot",
|
|
287
|
+
"file_id": "BAACAgIAAxkBAAI…"
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
| Field | Type | Meaning |
|
|
292
|
+
|---|---|---|
|
|
293
|
+
| `status` | string | `success`, or `processing` while a new video is being prepared — then call again after `retry_after` seconds |
|
|
294
|
+
| `file_id` | string | Telegram file id valid for `bot_username` — reusable, store it |
|
|
295
|
+
| `media_type` | string | `video` → `sendVideo`, `audio` → `sendAudio` |
|
|
296
|
+
| `size` | int | File size in bytes |
|
|
297
|
+
| `duration` | int | Length in seconds |
|
|
298
|
+
|
|
299
|
+
### `youtube_info()` — full metadata
|
|
300
|
+
|
|
301
|
+
```python
|
|
302
|
+
info = api.youtube_info("https://youtu.be/bICMVAhktBE")
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"ok": true,
|
|
308
|
+
"video_id": "bICMVAhktBE",
|
|
309
|
+
"title": "Shohjahon Jo'rayev - Farishtaginam (7-studiya ko'rsatuvida)",
|
|
310
|
+
"author": "JO'RAYEVLAR",
|
|
311
|
+
"author_url": "https://www.youtube.com/channel/UCEmb9urJ-ad8p-mdtYfOJIA",
|
|
312
|
+
"thumbnail": "https://i.ytimg.com/vi/bICMVAhktBE/maxresdefault.jpg",
|
|
313
|
+
"duration": 299,
|
|
314
|
+
"thumbnails": {
|
|
315
|
+
"low": "https://i.ytimg.com/vi/bICMVAhktBE/mqdefault.jpg",
|
|
316
|
+
"max": "https://i.ytimg.com/vi/bICMVAhktBE/maxresdefault.jpg"
|
|
317
|
+
},
|
|
318
|
+
"formats": [
|
|
319
|
+
{ "type": "video", "format": "144p", "filesize": 7390784 },
|
|
320
|
+
{ "type": "video", "format": "240p", "filesize": 8901511 }
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
`formats` lists every quality the video has, with its size in bytes — check it before asking `youtube()` for `1440` or `2160`.
|
|
326
|
+
|
|
327
|
+
### `youtube_info_basic()` — light metadata
|
|
328
|
+
|
|
329
|
+
```python
|
|
330
|
+
info = api.youtube_info_basic("https://youtu.be/bICMVAhktBE")
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
```json
|
|
334
|
+
{
|
|
335
|
+
"title": "Shohjahon Jo'rayev - Farishtaginam (7-studiya ko'rsatuvida)",
|
|
336
|
+
"author_name": "JO'RAYEVLAR",
|
|
337
|
+
"author_url": "https://www.youtube.com/@jorayevlar2790",
|
|
338
|
+
"type": "video",
|
|
339
|
+
"provider_name": "YouTube",
|
|
340
|
+
"thumbnail_url": "https://i.ytimg.com/vi/bICMVAhktBE/hqdefault.jpg",
|
|
341
|
+
"thumbnail_width": 480,
|
|
342
|
+
"thumbnail_height": 360,
|
|
343
|
+
"html": "<iframe width=\"200\" height=\"113\" src=\"https://www.youtube.com/embed/bICMVAhktBE?feature=oembed\" …></iframe>"
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### `instagram_profile()`
|
|
348
|
+
|
|
349
|
+
```python
|
|
350
|
+
profile = api.instagram_profile("cristiano")
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"error": false,
|
|
356
|
+
"user": {
|
|
357
|
+
"id": 173560420,
|
|
358
|
+
"username": "cristiano",
|
|
359
|
+
"full_name": "Cristiano Ronaldo",
|
|
360
|
+
"biography": "",
|
|
361
|
+
"external_url": "https://hrbl.me/CR7Pro2col",
|
|
362
|
+
"is_private": false,
|
|
363
|
+
"is_verified": true,
|
|
364
|
+
"profile_pic_url": "https://…/profile.jpg",
|
|
365
|
+
"stats": { "posts": 4121, "followers": 679697682, "following": 634 }
|
|
366
|
+
},
|
|
367
|
+
"counts": { "stories": 0, "highlights": 0, "posts": 12 },
|
|
368
|
+
"stories": [],
|
|
369
|
+
"highlights": [],
|
|
370
|
+
"posts": [
|
|
371
|
+
{ "id": "3968787288363683029_173560420", "type": "carousel", "url": "https://…/post.jpg", "taken_at": "2 days" }
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### `shazam_recognize()`
|
|
377
|
+
|
|
378
|
+
```python
|
|
379
|
+
song = api.shazam_recognize("https://example.com/clip.mp3")
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
```json
|
|
383
|
+
{
|
|
384
|
+
"matches": [{ "id": "804915529", "offset": 2.67, "timeskew": 0.0165, "frequencyskew": 0.0028 }],
|
|
385
|
+
"track": {
|
|
386
|
+
"key": "804915529",
|
|
387
|
+
"type": "MUSIC",
|
|
388
|
+
"title": "Nowy dzień",
|
|
389
|
+
"subtitle": "YOTAGAMI",
|
|
390
|
+
"images": {
|
|
391
|
+
"coverart": "https://is1-ssl.mzstatic.com/image/thumb/Music221/…/400x400cc.jpg",
|
|
392
|
+
"coverarthq": "https://is1-ssl.mzstatic.com/image/thumb/Music221/…/400x400cc.jpg"
|
|
393
|
+
},
|
|
394
|
+
"share": { "subject": "Nowy dzień - YOTAGAMI", "href": "https://www.shazam.com/track/804915529/…" },
|
|
395
|
+
"hub": { "type": "APPLEMUSIC", "providers": [{ "type": "SPOTIFY", "caption": "Open in Spotify" }] },
|
|
396
|
+
"genres": { "primary": "Dance" },
|
|
397
|
+
"url": "https://www.shazam.com/track/804915529/…"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
`track.title` is the song and `track.subtitle` the artist. When nothing is recognised, `matches` is empty and there is no `track` — use `song.get("track")`.
|
|
403
|
+
|
|
404
|
+
### `shazam_top()`
|
|
405
|
+
|
|
406
|
+
```python
|
|
407
|
+
top = api.shazam_top("united-states")
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
```json
|
|
411
|
+
{
|
|
412
|
+
"status": "success",
|
|
413
|
+
"country": "United States",
|
|
414
|
+
"country_code": "US",
|
|
415
|
+
"chart": "Top 200 United States",
|
|
416
|
+
"total_songs": 400,
|
|
417
|
+
"songs": [
|
|
418
|
+
{ "position": 1, "title": "Loser", "artist": "Tame Impala" }
|
|
419
|
+
]
|
|
420
|
+
}
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### `music_search()`
|
|
424
|
+
|
|
425
|
+
```python
|
|
426
|
+
found = api.music_search("Hello Adele", limit=5)
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
```json
|
|
430
|
+
{
|
|
431
|
+
"query": "Hello Adele",
|
|
432
|
+
"total_results": 5,
|
|
433
|
+
"results": [
|
|
434
|
+
{
|
|
435
|
+
"id": "YQHsXMglC9A",
|
|
436
|
+
"title": "Adele - Hello (Official Music Video)",
|
|
437
|
+
"artist": "Adele",
|
|
438
|
+
"duration": "6:07",
|
|
439
|
+
"thumbnail": "https://i.ytimg.com/vi/YQHsXMglC9A/mqdefault.jpg",
|
|
440
|
+
"year": ""
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
`id` is a YouTube video id — `api.youtube(f"https://youtu.be/{item['id']}", format="mp3")` turns a search hit into an audio file.
|
|
447
|
+
|
|
448
|
+
### `info_balance()` — free
|
|
449
|
+
|
|
450
|
+
```python
|
|
451
|
+
me = api.info_balance()
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
```json
|
|
455
|
+
{
|
|
456
|
+
"success": true,
|
|
457
|
+
"owner": "you@example.com",
|
|
458
|
+
"plan": { "name": "Pro" },
|
|
459
|
+
"credits_total": 100000,
|
|
460
|
+
"credits_remaining": 87350,
|
|
461
|
+
"credits_used": 12650,
|
|
462
|
+
"credits_used_percent": 12.7,
|
|
463
|
+
"limits": { "requests_per_second": 10, "requests_per_hour": 0, "requests_per_day": 0 },
|
|
464
|
+
"subscription": {
|
|
465
|
+
"purchased_at": "2026-11-01T09:00:00.000Z",
|
|
466
|
+
"expires_at": "2026-12-01T09:00:00.000Z",
|
|
467
|
+
"days_remaining": 7
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
A limit of `0` means unlimited. The answer is cached for up to 10 minutes.
|
|
473
|
+
|
|
474
|
+
### `api_keys_statistics()` — free
|
|
475
|
+
|
|
476
|
+
```python
|
|
477
|
+
stats = api.api_keys_statistics()
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
```json
|
|
481
|
+
{
|
|
482
|
+
"success": true,
|
|
483
|
+
"data": [
|
|
484
|
+
{
|
|
485
|
+
"apiKeyId": "cm…",
|
|
486
|
+
"apiKeyName": "Production",
|
|
487
|
+
"apiKey": "abcd1234efgh5678ijkl...",
|
|
488
|
+
"createdAt": "2026-09-01T10:00:00.000Z",
|
|
489
|
+
"statistics": {
|
|
490
|
+
"timePeriod": { "hourly": 42, "daily": 910, "weekly": 6120, "monthly": 25400, "total": 181300 },
|
|
491
|
+
"requests": { "success": 178900, "failed": 2400, "successRate": 98.7 },
|
|
492
|
+
"platforms": {
|
|
493
|
+
"YouTube": { "total": 90500, "success": 89600, "failed": 900, "hourly": 20, "daily": 450, "weekly": 3000, "monthly": 12600, "successRate": 99.0 },
|
|
494
|
+
"Instagram": { "total": 60100, "success": 59200, "failed": 900, "hourly": 15, "daily": 300, "weekly": 2100, "monthly": 8400, "successRate": 98.5 }
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
],
|
|
499
|
+
"cached": false,
|
|
500
|
+
"computedAt": "2026-11-24T05:00:00.000Z"
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
Statistics are cached for up to an hour. The two account samples above use illustrative numbers.
|
|
505
|
+
|
|
506
|
+
### `nsfw_scan()`
|
|
507
|
+
|
|
508
|
+
```python
|
|
509
|
+
verdict = api.nsfw_scan("https://example.com/image.jpg")
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Returns the scanner's verdict for the image or video as JSON; the live sample is in the [API docs](https://saverapi.net/docs).
|
|
513
|
+
|
|
514
|
+
### Errors
|
|
515
|
+
|
|
516
|
+
A failed call raises an exception (see [Errors and retries](#errors-and-retries)); the API's JSON body is kept on it:
|
|
517
|
+
|
|
518
|
+
```python
|
|
519
|
+
try:
|
|
520
|
+
api.download("https://www.instagram.com/p/private/")
|
|
521
|
+
except SaverAPIError as exc:
|
|
522
|
+
print(exc.status_code) # e.g. 400
|
|
523
|
+
print(exc.message) # "…"
|
|
524
|
+
print(exc.payload) # {"message": "…"}
|
|
525
|
+
```
|
|
526
|
+
|
|
191
527
|
## Async (aiogram, FastAPI, asyncio)
|
|
192
528
|
|
|
193
529
|
```python
|
|
@@ -314,6 +650,8 @@ Yes: `pip install "saverapi-client[async]"` and use `AsyncSaverAPI` — same met
|
|
|
314
650
|
- Shazam Song Recognition API: https://saverapi.net/shazam-api
|
|
315
651
|
- Social Media Downloader API: https://saverapi.net/social-media-downloader-api
|
|
316
652
|
- All-in-One Downloader API: https://saverapi.net/all-in-one-downloader-api
|
|
653
|
+
- Source code and issues: https://github.com/saverapinet/saverapi-python
|
|
654
|
+
- Open-source Telegram downloader bot built on this API: https://github.com/saverapinet/saverapi-telegram-bot
|
|
317
655
|
- Tutorials: https://saverapi.net/blog
|
|
318
656
|
- [YouTube downloader API in Python](https://saverapi.net/blog/youtube-downloader-api-python)
|
|
319
657
|
- [Build a Telegram YouTube downloader bot](https://saverapi.net/blog/build-telegram-youtube-downloader-bot)
|
|
@@ -324,6 +662,12 @@ Yes: `pip install "saverapi-client[async]"` and use `AsyncSaverAPI` — same met
|
|
|
324
662
|
|
|
325
663
|
## Changelog
|
|
326
664
|
|
|
665
|
+
**2.0.2**
|
|
666
|
+
- The SDK source is now public on GitHub: [saverapinet/saverapi-python](https://github.com/saverapinet/saverapi-python) — source and issue tracker linked from the package. No code changes.
|
|
667
|
+
|
|
668
|
+
**2.0.1**
|
|
669
|
+
- Documentation: new **Response reference** — a real JSON sample and key-field table for every method. No code changes.
|
|
670
|
+
|
|
327
671
|
**2.0.0**
|
|
328
672
|
- YouTube: `api.youtube()` now documents the new `2160` (4K) and `1440` (2K) formats; the full list is exported as `YOUTUBE_FORMATS`.
|
|
329
673
|
- YouTube for Telegram: `api.youtube_telegram(url, format, bot_username="@MyBot")` returns a ready `file_id` for your bot. New CLI command `saverapi youtube-telegram URL --bot @MyBot`.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{saverapi_client-2.0.0 → saverapi_client-2.0.2}/saverapi_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|