seoscoreapi 1.1.0__tar.gz → 1.2.0__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seoscoreapi
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Python client for SEO Score API — audit any URL for SEO issues with one function call
5
5
  Author-email: SEO Score API <info@seoscoreapi.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "seoscoreapi"
7
- version = "1.1.0"
7
+ version = "1.2.0"
8
8
  description = "Python client for SEO Score API — audit any URL for SEO issues with one function call"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -17,10 +17,12 @@ Usage:
17
17
  Full docs: https://seoscoreapi.com/docs
18
18
  """
19
19
 
20
+ from typing import Optional
21
+
20
22
  import requests
21
23
 
22
24
  BASE_URL = "https://seoscoreapi.com"
23
- __version__ = "1.1.0"
25
+ __version__ = "1.2.0"
24
26
 
25
27
  _HEADERS = {"User-Agent": f"seoscoreapi-python/{__version__}"}
26
28
 
@@ -74,6 +76,30 @@ def scoreboard_opt_out(api_key: str, opt_out: bool = True) -> dict:
74
76
  return r.json()
75
77
 
76
78
 
79
+ def competitive_audit(url: str, competitor_url: str, keyword: str, api_key: str) -> dict:
80
+ """Run a head-to-head competitive audit (Pro plan or higher). Returns gap score, per-check diffs, and action items."""
81
+ r = requests.post(f"{BASE_URL}/audit/competitive", json={"url": url, "competitor_url": competitor_url, "keyword": keyword}, headers={"X-API-Key": api_key, **_HEADERS})
82
+ r.raise_for_status()
83
+ return r.json()
84
+
85
+
77
86
  def report_url(domain: str) -> str:
78
87
  """Get the shareable report URL for a domain."""
79
88
  return f"{BASE_URL}/report/{domain}"
89
+
90
+
91
+ def history(url: str, api_key: str, limit: int = 100, since: Optional[float] = None) -> dict:
92
+ """Get historical audit scores and trend summary for a URL (Starter plan or higher)."""
93
+ params: dict = {"url": url, "limit": limit}
94
+ if since is not None:
95
+ params["since"] = since
96
+ r = requests.get(f"{BASE_URL}/history", params=params, headers={"X-API-Key": api_key, **_HEADERS})
97
+ r.raise_for_status()
98
+ return r.json()
99
+
100
+
101
+ def history_domains(api_key: str) -> list:
102
+ """List every domain audited by this key with latest score and 30-day trend (Starter plan or higher)."""
103
+ r = requests.get(f"{BASE_URL}/history/domains", headers={"X-API-Key": api_key, **_HEADERS})
104
+ r.raise_for_status()
105
+ return r.json()["domains"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seoscoreapi
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Python client for SEO Score API — audit any URL for SEO issues with one function call
5
5
  Author-email: SEO Score API <info@seoscoreapi.com>
6
6
  License: MIT
File without changes
File without changes