saverapi-client 1.0.2__tar.gz → 1.0.3__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.
@@ -1,12 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: saverapi-client
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Official Python SDK for SaverAPI.NET — download media from Instagram, TikTok, YouTube, Facebook, Twitter, and more. Includes Shazam recognition, NSFW scanner, music search & charts.
5
5
  Author-email: "SaverAPI.NET" <saverapinet@gmail.com>
6
6
  Project-URL: Homepage, https://saverapi.net
7
- Project-URL: Documentation, https://saverapi.net/docs
8
- Project-URL: Repository, https://saverapi.net
9
- Project-URL: Bug Tracker, https://saverapi.net
7
+ Project-URL: Documentation, https://saverapi.net/user/documentation
10
8
  Keywords: instagram downloader,instagram reel downloader,tiktok downloader,tiktok video api,youtube downloader,youtube api python,social media downloader,video downloader api,media downloader,api client python,python sdk,instagram api,tiktok api,youtube video download,reels downloader,shorts downloader,facebook video downloader,twitter video downloader,x video downloader,scraping api,automation api,fast api client,high performance api,download videos python,python downloader library,saverapi,saverapi client,shazam api,shazam recognize,music recognition,nsfw scanner,nsfw detection,music search api,shazam top charts,youtube info,snapchat downloader,pinterest downloader,threads downloader,soundcloud downloader,spotify downloader,vimeo downloader,twitch downloader,likee downloader,weibo downloader
11
9
  Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Intended Audience :: Developers
@@ -79,6 +77,8 @@ api = SaverAPI(api_key="YOUR_API_KEY")
79
77
  | 5 | `api.music_search(query, limit)` | `/music-search` |
80
78
  | 6 | `api.youtube(url, format)` | `/youtube-api` |
81
79
  | 7 | `api.download(url)` | `/all-in-one-downloader-api` |
80
+ | 8 | `api.info_balance()` | `/infobalans` |
81
+ | 9 | `api.api_keys_statistics()` | `/api-keys/all-statistics` |
82
82
 
83
83
  ---
84
84
 
@@ -316,6 +316,84 @@ print("→", data["download_url"])
316
316
 
317
317
  ---
318
318
 
319
+ ## 8️⃣ Account Balance — `info_balance`
320
+
321
+ Check your plan, remaining credits and subscription dates.
322
+
323
+ ```python
324
+ balance = api.info_balance()
325
+
326
+ print("Plan:", balance["plan"]["name"])
327
+ print("Credits:", balance["credits_remaining"], "/", balance["credits_total"])
328
+ print("Expires:", balance["subscription"]["expires_at"])
329
+ ```
330
+
331
+ **Response**
332
+
333
+ ```json
334
+ {
335
+ "success": true,
336
+ "owner": "user@example.com",
337
+ "plan": { "name": "Pro" },
338
+ "credits_total": 1000,
339
+ "credits_remaining": 420,
340
+ "subscription": {
341
+ "purchased_at": "2025-10-22T19:00:00.000Z",
342
+ "expires_at": "2025-11-21T19:00:00.000Z"
343
+ }
344
+ }
345
+ ```
346
+
347
+ ---
348
+
349
+ ## 9️⃣ API Keys Statistics — `api_keys_statistics`
350
+
351
+ Full per-key usage analytics: hourly / daily / weekly / monthly counts, success rate, and breakdown by platform (YouTube, Instagram, TikTok, Twitter, …).
352
+
353
+ ```python
354
+ stats = api.api_keys_statistics()
355
+
356
+ for key in stats["data"]:
357
+ s = key["statistics"]
358
+ print(f"🔑 {key['apiKeyName']} ({key['apiKey']})")
359
+ print(f" Total: {s['timePeriod']['total']} · Success rate: {s['requests']['successRate']}%")
360
+ for platform, data in s["platforms"].items():
361
+ print(f" • {platform}: {data['total']} ({data['successRate']}%)")
362
+ ```
363
+
364
+ **Response (excerpt)**
365
+
366
+ ```json
367
+ {
368
+ "success": true,
369
+ "data": [
370
+ {
371
+ "apiKeyId": "cmlvlzuuasdsadf1wmzgasdjzkwasdsaxfzbqjz",
372
+ "apiKeyName": "app",
373
+ "apiKey": "sk_mlvlzuue_300dsdsa386...",
374
+ "createdAt": "2026-02-21T00:57:15.495Z",
375
+ "statistics": {
376
+ "timePeriod": {
377
+ "hourly": 47, "daily": 1101, "weekly": 3324,
378
+ "monthly": 3397, "total": 3626
379
+ },
380
+ "requests": { "success": 3559, "failed": 67, "successRate": 98.2 },
381
+ "platforms": {
382
+ "YouTube": { "total": 158, "successRate": 70.9 },
383
+ "Instagram": { "total": 82, "successRate": 98.8 },
384
+ "TikTok": { "total": 19, "successRate": 100 },
385
+ "Twitter": { "total": 7, "successRate": 100 }
386
+ }
387
+ }
388
+ }
389
+ ],
390
+ "cached": false,
391
+ "computedAt": "2026-05-08T10:38:47.308Z"
392
+ }
393
+ ```
394
+
395
+ ---
396
+
319
397
  ## 🔁 Run them all in sequence
320
398
 
321
399
  ```python
@@ -331,6 +409,8 @@ calls = [
331
409
  ("Search", lambda: api.music_search("Hello!", limit=10)),
332
410
  ("YT dl", lambda: api.youtube("https://youtu.be/OORSiK8ScTI", format="720")),
333
411
  ("All-in-one", lambda: api.download("https://www.instagram.com/reel/DPOi9V-CAqH/")),
412
+ ("Balance", lambda: api.info_balance()),
413
+ ("Stats", lambda: api.api_keys_statistics()),
334
414
  ]
335
415
 
336
416
  for name, fn in calls:
@@ -342,40 +422,6 @@ for name, fn in calls:
342
422
 
343
423
  ---
344
424
 
345
- ## 🛡️ Error handling
346
-
347
- ```python
348
- from saverapi import SaverAPI, SaverAPIError
349
-
350
- api = SaverAPI(api_key="YOUR_API_KEY")
351
-
352
- try:
353
- api.download("https://broken-link/")
354
- except SaverAPIError as e:
355
- print(e.status_code, e.message, e.payload)
356
- ```
357
-
358
- ---
359
-
360
- ## 🧰 Advanced usage
361
-
362
- ```python
363
- import requests
364
- from saverapi import SaverAPI
365
-
366
- session = requests.Session()
367
- session.proxies = {"https": "http://127.0.0.1:8080"}
368
-
369
- api = SaverAPI(
370
- api_key="YOUR_API_KEY",
371
- timeout=60,
372
- session=session, # bring your own session
373
- base_url="https://saverapi.net/api" # custom base URL if needed
374
- )
375
- ```
376
-
377
- ---
378
-
379
425
  ## 📞 Support
380
426
 
381
427
  - 🌍 Website — <https://saverapi.net>
@@ -50,6 +50,8 @@ api = SaverAPI(api_key="YOUR_API_KEY")
50
50
  | 5 | `api.music_search(query, limit)` | `/music-search` |
51
51
  | 6 | `api.youtube(url, format)` | `/youtube-api` |
52
52
  | 7 | `api.download(url)` | `/all-in-one-downloader-api` |
53
+ | 8 | `api.info_balance()` | `/infobalans` |
54
+ | 9 | `api.api_keys_statistics()` | `/api-keys/all-statistics` |
53
55
 
54
56
  ---
55
57
 
@@ -287,6 +289,84 @@ print("→", data["download_url"])
287
289
 
288
290
  ---
289
291
 
292
+ ## 8️⃣ Account Balance — `info_balance`
293
+
294
+ Check your plan, remaining credits and subscription dates.
295
+
296
+ ```python
297
+ balance = api.info_balance()
298
+
299
+ print("Plan:", balance["plan"]["name"])
300
+ print("Credits:", balance["credits_remaining"], "/", balance["credits_total"])
301
+ print("Expires:", balance["subscription"]["expires_at"])
302
+ ```
303
+
304
+ **Response**
305
+
306
+ ```json
307
+ {
308
+ "success": true,
309
+ "owner": "user@example.com",
310
+ "plan": { "name": "Pro" },
311
+ "credits_total": 1000,
312
+ "credits_remaining": 420,
313
+ "subscription": {
314
+ "purchased_at": "2025-10-22T19:00:00.000Z",
315
+ "expires_at": "2025-11-21T19:00:00.000Z"
316
+ }
317
+ }
318
+ ```
319
+
320
+ ---
321
+
322
+ ## 9️⃣ API Keys Statistics — `api_keys_statistics`
323
+
324
+ Full per-key usage analytics: hourly / daily / weekly / monthly counts, success rate, and breakdown by platform (YouTube, Instagram, TikTok, Twitter, …).
325
+
326
+ ```python
327
+ stats = api.api_keys_statistics()
328
+
329
+ for key in stats["data"]:
330
+ s = key["statistics"]
331
+ print(f"🔑 {key['apiKeyName']} ({key['apiKey']})")
332
+ print(f" Total: {s['timePeriod']['total']} · Success rate: {s['requests']['successRate']}%")
333
+ for platform, data in s["platforms"].items():
334
+ print(f" • {platform}: {data['total']} ({data['successRate']}%)")
335
+ ```
336
+
337
+ **Response (excerpt)**
338
+
339
+ ```json
340
+ {
341
+ "success": true,
342
+ "data": [
343
+ {
344
+ "apiKeyId": "cmlvlzuuasdsadf1wmzgasdjzkwasdsaxfzbqjz",
345
+ "apiKeyName": "app",
346
+ "apiKey": "sk_mlvlzuue_300dsdsa386...",
347
+ "createdAt": "2026-02-21T00:57:15.495Z",
348
+ "statistics": {
349
+ "timePeriod": {
350
+ "hourly": 47, "daily": 1101, "weekly": 3324,
351
+ "monthly": 3397, "total": 3626
352
+ },
353
+ "requests": { "success": 3559, "failed": 67, "successRate": 98.2 },
354
+ "platforms": {
355
+ "YouTube": { "total": 158, "successRate": 70.9 },
356
+ "Instagram": { "total": 82, "successRate": 98.8 },
357
+ "TikTok": { "total": 19, "successRate": 100 },
358
+ "Twitter": { "total": 7, "successRate": 100 }
359
+ }
360
+ }
361
+ }
362
+ ],
363
+ "cached": false,
364
+ "computedAt": "2026-05-08T10:38:47.308Z"
365
+ }
366
+ ```
367
+
368
+ ---
369
+
290
370
  ## 🔁 Run them all in sequence
291
371
 
292
372
  ```python
@@ -302,6 +382,8 @@ calls = [
302
382
  ("Search", lambda: api.music_search("Hello!", limit=10)),
303
383
  ("YT dl", lambda: api.youtube("https://youtu.be/OORSiK8ScTI", format="720")),
304
384
  ("All-in-one", lambda: api.download("https://www.instagram.com/reel/DPOi9V-CAqH/")),
385
+ ("Balance", lambda: api.info_balance()),
386
+ ("Stats", lambda: api.api_keys_statistics()),
305
387
  ]
306
388
 
307
389
  for name, fn in calls:
@@ -313,40 +395,6 @@ for name, fn in calls:
313
395
 
314
396
  ---
315
397
 
316
- ## 🛡️ Error handling
317
-
318
- ```python
319
- from saverapi import SaverAPI, SaverAPIError
320
-
321
- api = SaverAPI(api_key="YOUR_API_KEY")
322
-
323
- try:
324
- api.download("https://broken-link/")
325
- except SaverAPIError as e:
326
- print(e.status_code, e.message, e.payload)
327
- ```
328
-
329
- ---
330
-
331
- ## 🧰 Advanced usage
332
-
333
- ```python
334
- import requests
335
- from saverapi import SaverAPI
336
-
337
- session = requests.Session()
338
- session.proxies = {"https": "http://127.0.0.1:8080"}
339
-
340
- api = SaverAPI(
341
- api_key="YOUR_API_KEY",
342
- timeout=60,
343
- session=session, # bring your own session
344
- base_url="https://saverapi.net/api" # custom base URL if needed
345
- )
346
- ```
347
-
348
- ---
349
-
350
398
  ## 📞 Support
351
399
 
352
400
  - 🌍 Website — <https://saverapi.net>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "saverapi-client"
3
- version = "1.0.2"
3
+ version = "1.0.3"
4
4
  description = "Official Python SDK for SaverAPI.NET — download media from Instagram, TikTok, YouTube, Facebook, Twitter, and more. Includes Shazam recognition, NSFW scanner, music search & charts."
5
5
  readme = { file = "README.md", content-type = "text/markdown" }
6
6
  requires-python = ">=3.7"
@@ -74,9 +74,7 @@ classifiers = [
74
74
 
75
75
  [project.urls]
76
76
  Homepage = "https://saverapi.net"
77
- Documentation = "https://saverapi.net/docs"
78
- Repository = "https://saverapi.net"
79
- "Bug Tracker" = "https://saverapi.net"
77
+ Documentation = "https://saverapi.net/user/documentation"
80
78
 
81
79
  [build-system]
82
80
  requires = ["setuptools", "wheel"]
@@ -1,4 +1,4 @@
1
1
  from .client import SaverAPI, SaverAPIError
2
2
 
3
- __version__ = "1.0.2"
3
+ __version__ = "1.0.3"
4
4
  __all__ = ["SaverAPI", "SaverAPIError", "__version__"]
@@ -55,7 +55,7 @@ class SaverAPI:
55
55
  {
56
56
  "x-api-key": self.api_key,
57
57
  "Content-Type": "application/json",
58
- "User-Agent": "saverapi-client/1.0.2 (+https://saverapi.net)",
58
+ "User-Agent": "saverapi-client/1.0.3 (+https://saverapi.net)",
59
59
  }
60
60
  )
61
61
 
@@ -132,6 +132,17 @@ class SaverAPI:
132
132
  """Scan an image / video URL and return an NSFW probability score."""
133
133
  return self._request("/nsfw-scanner-api", {"url": url})
134
134
 
135
+ # ------------------------------------------------------------------ #
136
+ # Account / Billing
137
+ # ------------------------------------------------------------------ #
138
+ def info_balance(self) -> Dict[str, Any]:
139
+ """Return account info: plan, owner, total/remaining credits and subscription dates."""
140
+ return self._request("/infobalans")
141
+
142
+ def api_keys_statistics(self) -> Dict[str, Any]:
143
+ """Return per-API-key usage statistics across all platforms (hourly/daily/weekly/monthly)."""
144
+ return self._request("/api-keys/all-statistics")
145
+
135
146
  # ------------------------------------------------------------------ #
136
147
  # Helpers
137
148
  # ------------------------------------------------------------------ #
@@ -1,12 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: saverapi-client
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Official Python SDK for SaverAPI.NET — download media from Instagram, TikTok, YouTube, Facebook, Twitter, and more. Includes Shazam recognition, NSFW scanner, music search & charts.
5
5
  Author-email: "SaverAPI.NET" <saverapinet@gmail.com>
6
6
  Project-URL: Homepage, https://saverapi.net
7
- Project-URL: Documentation, https://saverapi.net/docs
8
- Project-URL: Repository, https://saverapi.net
9
- Project-URL: Bug Tracker, https://saverapi.net
7
+ Project-URL: Documentation, https://saverapi.net/user/documentation
10
8
  Keywords: instagram downloader,instagram reel downloader,tiktok downloader,tiktok video api,youtube downloader,youtube api python,social media downloader,video downloader api,media downloader,api client python,python sdk,instagram api,tiktok api,youtube video download,reels downloader,shorts downloader,facebook video downloader,twitter video downloader,x video downloader,scraping api,automation api,fast api client,high performance api,download videos python,python downloader library,saverapi,saverapi client,shazam api,shazam recognize,music recognition,nsfw scanner,nsfw detection,music search api,shazam top charts,youtube info,snapchat downloader,pinterest downloader,threads downloader,soundcloud downloader,spotify downloader,vimeo downloader,twitch downloader,likee downloader,weibo downloader
11
9
  Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Intended Audience :: Developers
@@ -79,6 +77,8 @@ api = SaverAPI(api_key="YOUR_API_KEY")
79
77
  | 5 | `api.music_search(query, limit)` | `/music-search` |
80
78
  | 6 | `api.youtube(url, format)` | `/youtube-api` |
81
79
  | 7 | `api.download(url)` | `/all-in-one-downloader-api` |
80
+ | 8 | `api.info_balance()` | `/infobalans` |
81
+ | 9 | `api.api_keys_statistics()` | `/api-keys/all-statistics` |
82
82
 
83
83
  ---
84
84
 
@@ -316,6 +316,84 @@ print("→", data["download_url"])
316
316
 
317
317
  ---
318
318
 
319
+ ## 8️⃣ Account Balance — `info_balance`
320
+
321
+ Check your plan, remaining credits and subscription dates.
322
+
323
+ ```python
324
+ balance = api.info_balance()
325
+
326
+ print("Plan:", balance["plan"]["name"])
327
+ print("Credits:", balance["credits_remaining"], "/", balance["credits_total"])
328
+ print("Expires:", balance["subscription"]["expires_at"])
329
+ ```
330
+
331
+ **Response**
332
+
333
+ ```json
334
+ {
335
+ "success": true,
336
+ "owner": "user@example.com",
337
+ "plan": { "name": "Pro" },
338
+ "credits_total": 1000,
339
+ "credits_remaining": 420,
340
+ "subscription": {
341
+ "purchased_at": "2025-10-22T19:00:00.000Z",
342
+ "expires_at": "2025-11-21T19:00:00.000Z"
343
+ }
344
+ }
345
+ ```
346
+
347
+ ---
348
+
349
+ ## 9️⃣ API Keys Statistics — `api_keys_statistics`
350
+
351
+ Full per-key usage analytics: hourly / daily / weekly / monthly counts, success rate, and breakdown by platform (YouTube, Instagram, TikTok, Twitter, …).
352
+
353
+ ```python
354
+ stats = api.api_keys_statistics()
355
+
356
+ for key in stats["data"]:
357
+ s = key["statistics"]
358
+ print(f"🔑 {key['apiKeyName']} ({key['apiKey']})")
359
+ print(f" Total: {s['timePeriod']['total']} · Success rate: {s['requests']['successRate']}%")
360
+ for platform, data in s["platforms"].items():
361
+ print(f" • {platform}: {data['total']} ({data['successRate']}%)")
362
+ ```
363
+
364
+ **Response (excerpt)**
365
+
366
+ ```json
367
+ {
368
+ "success": true,
369
+ "data": [
370
+ {
371
+ "apiKeyId": "cmlvlzuuasdsadf1wmzgasdjzkwasdsaxfzbqjz",
372
+ "apiKeyName": "app",
373
+ "apiKey": "sk_mlvlzuue_300dsdsa386...",
374
+ "createdAt": "2026-02-21T00:57:15.495Z",
375
+ "statistics": {
376
+ "timePeriod": {
377
+ "hourly": 47, "daily": 1101, "weekly": 3324,
378
+ "monthly": 3397, "total": 3626
379
+ },
380
+ "requests": { "success": 3559, "failed": 67, "successRate": 98.2 },
381
+ "platforms": {
382
+ "YouTube": { "total": 158, "successRate": 70.9 },
383
+ "Instagram": { "total": 82, "successRate": 98.8 },
384
+ "TikTok": { "total": 19, "successRate": 100 },
385
+ "Twitter": { "total": 7, "successRate": 100 }
386
+ }
387
+ }
388
+ }
389
+ ],
390
+ "cached": false,
391
+ "computedAt": "2026-05-08T10:38:47.308Z"
392
+ }
393
+ ```
394
+
395
+ ---
396
+
319
397
  ## 🔁 Run them all in sequence
320
398
 
321
399
  ```python
@@ -331,6 +409,8 @@ calls = [
331
409
  ("Search", lambda: api.music_search("Hello!", limit=10)),
332
410
  ("YT dl", lambda: api.youtube("https://youtu.be/OORSiK8ScTI", format="720")),
333
411
  ("All-in-one", lambda: api.download("https://www.instagram.com/reel/DPOi9V-CAqH/")),
412
+ ("Balance", lambda: api.info_balance()),
413
+ ("Stats", lambda: api.api_keys_statistics()),
334
414
  ]
335
415
 
336
416
  for name, fn in calls:
@@ -342,40 +422,6 @@ for name, fn in calls:
342
422
 
343
423
  ---
344
424
 
345
- ## 🛡️ Error handling
346
-
347
- ```python
348
- from saverapi import SaverAPI, SaverAPIError
349
-
350
- api = SaverAPI(api_key="YOUR_API_KEY")
351
-
352
- try:
353
- api.download("https://broken-link/")
354
- except SaverAPIError as e:
355
- print(e.status_code, e.message, e.payload)
356
- ```
357
-
358
- ---
359
-
360
- ## 🧰 Advanced usage
361
-
362
- ```python
363
- import requests
364
- from saverapi import SaverAPI
365
-
366
- session = requests.Session()
367
- session.proxies = {"https": "http://127.0.0.1:8080"}
368
-
369
- api = SaverAPI(
370
- api_key="YOUR_API_KEY",
371
- timeout=60,
372
- session=session, # bring your own session
373
- base_url="https://saverapi.net/api" # custom base URL if needed
374
- )
375
- ```
376
-
377
- ---
378
-
379
425
  ## 📞 Support
380
426
 
381
427
  - 🌍 Website — <https://saverapi.net>