agentweb-mcp 0.1.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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 AgentWeb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentweb-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for AgentWeb.live — the global business directory for AI agents
|
|
5
|
+
Project-URL: Homepage, https://agentweb.live
|
|
6
|
+
Project-URL: Repository, https://github.com/zerabic/agentweb-python
|
|
7
|
+
Author-email: AgentWeb <hello@agentweb.live>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: agentweb,ai-agents,api,business,directory
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Requires-Dist: requests>=2.20
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# agentweb
|
|
20
|
+
|
|
21
|
+
Python SDK for [AgentWeb.live](https://agentweb.live) — the global business directory for AI agents.
|
|
22
|
+
|
|
23
|
+
Search 11M+ businesses across 195 countries via a simple API.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install agentweb
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from agentweb import AgentWebClient
|
|
35
|
+
|
|
36
|
+
client = AgentWebClient(api_key="your-api-key")
|
|
37
|
+
|
|
38
|
+
# Search for businesses
|
|
39
|
+
results = client.search("coffee shop", country="US", limit=5)
|
|
40
|
+
print(results)
|
|
41
|
+
|
|
42
|
+
# Geo search
|
|
43
|
+
results = client.search("restaurant", lat=40.7128, lng=-74.0060, radius_km=2)
|
|
44
|
+
|
|
45
|
+
# Get a single business
|
|
46
|
+
biz = client.get_business("some-business-id")
|
|
47
|
+
|
|
48
|
+
# Health check
|
|
49
|
+
status = client.health()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## API Reference
|
|
53
|
+
|
|
54
|
+
### `AgentWebClient(api_key, base_url=..., timeout=30)`
|
|
55
|
+
|
|
56
|
+
Create a client. Get your API key at [agentweb.live](https://agentweb.live).
|
|
57
|
+
|
|
58
|
+
### `client.search(q, *, lat, lng, radius_km, country, limit)`
|
|
59
|
+
|
|
60
|
+
Search for businesses. All parameters except `q` are optional.
|
|
61
|
+
|
|
62
|
+
### `client.get_business(business_id)`
|
|
63
|
+
|
|
64
|
+
Fetch a single business by its AgentWeb ID.
|
|
65
|
+
|
|
66
|
+
### `client.health()`
|
|
67
|
+
|
|
68
|
+
Check API health and stats.
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# agentweb
|
|
2
|
+
|
|
3
|
+
Python SDK for [AgentWeb.live](https://agentweb.live) — the global business directory for AI agents.
|
|
4
|
+
|
|
5
|
+
Search 11M+ businesses across 195 countries via a simple API.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install agentweb
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from agentweb import AgentWebClient
|
|
17
|
+
|
|
18
|
+
client = AgentWebClient(api_key="your-api-key")
|
|
19
|
+
|
|
20
|
+
# Search for businesses
|
|
21
|
+
results = client.search("coffee shop", country="US", limit=5)
|
|
22
|
+
print(results)
|
|
23
|
+
|
|
24
|
+
# Geo search
|
|
25
|
+
results = client.search("restaurant", lat=40.7128, lng=-74.0060, radius_km=2)
|
|
26
|
+
|
|
27
|
+
# Get a single business
|
|
28
|
+
biz = client.get_business("some-business-id")
|
|
29
|
+
|
|
30
|
+
# Health check
|
|
31
|
+
status = client.health()
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## API Reference
|
|
35
|
+
|
|
36
|
+
### `AgentWebClient(api_key, base_url=..., timeout=30)`
|
|
37
|
+
|
|
38
|
+
Create a client. Get your API key at [agentweb.live](https://agentweb.live).
|
|
39
|
+
|
|
40
|
+
### `client.search(q, *, lat, lng, radius_km, country, limit)`
|
|
41
|
+
|
|
42
|
+
Search for businesses. All parameters except `q` are optional.
|
|
43
|
+
|
|
44
|
+
### `client.get_business(business_id)`
|
|
45
|
+
|
|
46
|
+
Fetch a single business by its AgentWeb ID.
|
|
47
|
+
|
|
48
|
+
### `client.health()`
|
|
49
|
+
|
|
50
|
+
Check API health and stats.
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""AgentWeb API client."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, Optional
|
|
6
|
+
|
|
7
|
+
import requests
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentWebError(Exception):
|
|
11
|
+
"""Raised when the API returns a non-2xx response."""
|
|
12
|
+
|
|
13
|
+
def __init__(self, status_code: int, detail: Any = None):
|
|
14
|
+
self.status_code = status_code
|
|
15
|
+
self.detail = detail
|
|
16
|
+
super().__init__(f"HTTP {status_code}: {detail}")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AgentWebClient:
|
|
20
|
+
"""Client for the AgentWeb.live business directory API.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
api_key: Your AgentWeb API key.
|
|
24
|
+
base_url: API base URL (default: https://api.agentweb.live/v1).
|
|
25
|
+
timeout: Request timeout in seconds.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(
|
|
29
|
+
self,
|
|
30
|
+
api_key: str,
|
|
31
|
+
base_url: str = "https://api.agentweb.live/v1",
|
|
32
|
+
timeout: float = 30,
|
|
33
|
+
):
|
|
34
|
+
self.base_url = base_url.rstrip("/")
|
|
35
|
+
self.timeout = timeout
|
|
36
|
+
self._session = requests.Session()
|
|
37
|
+
self._session.headers.update({"X-API-Key": api_key})
|
|
38
|
+
|
|
39
|
+
# ------------------------------------------------------------------
|
|
40
|
+
# Public helpers
|
|
41
|
+
# ------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
def _get(self, path: str, params: Optional[dict] = None) -> Any:
|
|
44
|
+
url = f"{self.base_url}{path}"
|
|
45
|
+
resp = self._session.get(url, params=params, timeout=self.timeout)
|
|
46
|
+
if not resp.ok:
|
|
47
|
+
raise AgentWebError(resp.status_code, resp.text)
|
|
48
|
+
return resp.json()
|
|
49
|
+
|
|
50
|
+
# ------------------------------------------------------------------
|
|
51
|
+
# Endpoints
|
|
52
|
+
# ------------------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
def search(
|
|
55
|
+
self,
|
|
56
|
+
q: str,
|
|
57
|
+
*,
|
|
58
|
+
lat: Optional[float] = None,
|
|
59
|
+
lng: Optional[float] = None,
|
|
60
|
+
radius_km: Optional[float] = None,
|
|
61
|
+
country: Optional[str] = None,
|
|
62
|
+
limit: Optional[int] = None,
|
|
63
|
+
) -> dict[str, Any]:
|
|
64
|
+
"""Search for businesses.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
q: Search query (e.g. "coffee shop").
|
|
68
|
+
lat: Latitude for geo search.
|
|
69
|
+
lng: Longitude for geo search.
|
|
70
|
+
radius_km: Radius in km for geo search.
|
|
71
|
+
country: ISO 3166-1 alpha-2 country code filter.
|
|
72
|
+
limit: Maximum number of results.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
API response as a dict.
|
|
76
|
+
"""
|
|
77
|
+
params: dict[str, Any] = {"q": q}
|
|
78
|
+
if lat is not None:
|
|
79
|
+
params["lat"] = lat
|
|
80
|
+
if lng is not None:
|
|
81
|
+
params["lng"] = lng
|
|
82
|
+
if radius_km is not None:
|
|
83
|
+
params["radius_km"] = radius_km
|
|
84
|
+
if country is not None:
|
|
85
|
+
params["country"] = country
|
|
86
|
+
if limit is not None:
|
|
87
|
+
params["limit"] = limit
|
|
88
|
+
return self._get("/search", params)
|
|
89
|
+
|
|
90
|
+
def get_business(self, business_id: str) -> dict[str, Any]:
|
|
91
|
+
"""Get a single business by ID.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
business_id: The AgentWeb business ID.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
Business data as a dict.
|
|
98
|
+
"""
|
|
99
|
+
return self._get(f"/business/{business_id}")
|
|
100
|
+
|
|
101
|
+
def health(self) -> dict[str, Any]:
|
|
102
|
+
"""Check API health and stats.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
Health/status info as a dict.
|
|
106
|
+
"""
|
|
107
|
+
return self._get("/health")
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agentweb-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Python SDK for AgentWeb.live — the global business directory for AI agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
authors = [{ name = "AgentWeb", email = "hello@agentweb.live" }]
|
|
13
|
+
keywords = ["agentweb", "business", "directory", "api", "ai-agents"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
]
|
|
20
|
+
dependencies = ["requests>=2.20"]
|
|
21
|
+
|
|
22
|
+
[project.urls]
|
|
23
|
+
Homepage = "https://agentweb.live"
|
|
24
|
+
Repository = "https://github.com/zerabic/agentweb-python"
|
|
25
|
+
|
|
26
|
+
[tool.hatch.build.targets.wheel]
|
|
27
|
+
packages = ["agentweb"]
|