specstream-client 1.3.2__tar.gz → 1.3.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.
Files changed (19) hide show
  1. {specstream_client-1.3.2 → specstream_client-1.3.3}/PKG-INFO +62 -2
  2. {specstream_client-1.3.2 → specstream_client-1.3.3}/README.md +61 -1
  3. {specstream_client-1.3.2 → specstream_client-1.3.3}/pyproject.toml +1 -1
  4. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/__init__.py +1 -1
  5. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/client.py +5 -4
  6. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/lifecycle_commands.py +5 -5
  7. {specstream_client-1.3.2 → specstream_client-1.3.3}/.gitignore +0 -0
  8. {specstream_client-1.3.2 → specstream_client-1.3.3}/LICENSE +0 -0
  9. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/__main__.py +0 -0
  10. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/authorization.py +0 -0
  11. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/cli.py +0 -0
  12. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/families.py +0 -0
  13. {specstream_client-1.3.2 → specstream_client-1.3.3}/specstream_client/py.typed +0 -0
  14. {specstream_client-1.3.2 → specstream_client-1.3.3}/tests/__init__.py +0 -0
  15. {specstream_client-1.3.2 → specstream_client-1.3.3}/tests/test_cli.py +0 -0
  16. {specstream_client-1.3.2 → specstream_client-1.3.3}/tests/test_client.py +0 -0
  17. {specstream_client-1.3.2 → specstream_client-1.3.3}/tests/test_convergence.py +0 -0
  18. {specstream_client-1.3.2 → specstream_client-1.3.3}/tests/test_http_boundary.py +0 -0
  19. {specstream_client-1.3.2 → specstream_client-1.3.3}/tests/test_m16_exports.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: specstream-client
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Python client for building lead lists and company lists from the live web. Every match comes with its source, priced before it runs.
5
5
  Project-URL: Homepage, https://specstream.ai
6
6
  Project-URL: Documentation, https://specstream.ai/docs/sdk
@@ -50,6 +50,66 @@ Create an API key under **Agents & API** in your SpecStream workspace and keep i
50
50
  export SPECSTREAM_API_KEY="ss_live_..."
51
51
  ```
52
52
 
53
+ ## Search the web
54
+
55
+ `web_search` calls the [Search API](https://specstream.ai/docs/search-api), `GET /v1/web-search`, at $5 per 1,000 searches of up to 10 results.
56
+
57
+ ```python
58
+ import os
59
+ from specstream_client import Client
60
+
61
+ client = Client(os.environ["SPECSTREAM_API_KEY"])
62
+
63
+ search = client.web_search(q="What is the population of Japan?")
64
+ for source in search["sources"][:1]:
65
+ print(source["title"], source["url"], source["snippet"])
66
+ ```
67
+
68
+ ## Extract pages
69
+
70
+ `extract_pages` calls the [Extract API](https://specstream.ai/docs/extract-api), `POST /v1/extract`, at $0.80 per 1,000 pages, and a page with no text is not charged.
71
+
72
+ ```python
73
+ import os
74
+ from specstream_client import Client
75
+
76
+ client = Client(os.environ["SPECSTREAM_API_KEY"])
77
+
78
+ extract = client.extract_pages({"urls": ["https://example.com"]})
79
+ for page in extract["results"][:1]:
80
+ print(page["title"], page["url"], page["text"])
81
+ ```
82
+
83
+ ## Drop-in for the API you already call
84
+
85
+ SpecStream answers calls written for these search APIs at its own address, in each API's own reply shape. To switch, change the base address and the key. Each search call is one Search API web search on your SpecStream key: $0.005 for up to 10 results ($5 per 1,000 searches), and each 10 results more in the same call add $0.006.
86
+
87
+ | API you call | Base address you have | SpecStream address | Where the SpecStream key goes |
88
+ | --- | --- | --- | --- |
89
+ | Tavily | `https://api.tavily.com` | `https://api.specstream.ai/tavily` | Bearer token or `api_key` |
90
+ | Exa | `https://api.exa.ai` | `https://api.specstream.ai/exa` | `x-api-key` or Bearer token |
91
+ | Brave Search API | `https://api.search.brave.com` | `https://api.specstream.ai` | `X-Subscription-Token` |
92
+ | Serper | `https://google.serper.dev` | `https://api.specstream.ai/serper` | `X-API-KEY` |
93
+ | Bing Web Search API v7 | `https://api.bing.microsoft.com/v7.0/search` | `https://api.specstream.ai/v7.0/search` | `Ocp-Apim-Subscription-Key` |
94
+ | Google Custom Search JSON API | `https://www.googleapis.com` or `https://customsearch.googleapis.com` | `https://api.specstream.ai` | `key=` (`cx` is accepted and not used) |
95
+ | SearXNG (JSON) | your instance address | `https://api.specstream.ai/searxng/<key>` | in the address, `key=`, `X-API-Key` or Bearer token |
96
+ | Firecrawl v2 | `https://api.firecrawl.dev` | `https://api.specstream.ai/firecrawl` | Bearer token |
97
+
98
+ The official Tavily and Exa Python SDKs take the address as an argument:
99
+
100
+ ```python
101
+ import os
102
+ from tavily import TavilyClient
103
+ from exa_py import Exa
104
+
105
+ tavily = TavilyClient(api_key=os.environ["SPECSTREAM_API_KEY"], api_base_url="https://api.specstream.ai/tavily")
106
+ exa = Exa(api_key=os.environ["SPECSTREAM_API_KEY"], base_url="https://api.specstream.ai/exa")
107
+ ```
108
+
109
+ - A Brave call that sends no `count` is priced as 20 results ($0.011). Send `count=10` for $0.005.
110
+ - A Firecrawl `/v2/scrape` call is one Extract API page at $0.0008. The Firecrawl JavaScript SDK works with this address; the Firecrawl Python SDK does not yet.
111
+ - Each route's request and reply fields: [specstream.ai/agents.md](https://specstream.ai/agents.md). Create a key under **Agents & API** at [specstream.ai/workspace](https://specstream.ai/workspace). New accounts start with $10 of credit, no card.
112
+
53
113
  ## Read a request, get the price
54
114
 
55
115
  ```python
@@ -113,7 +173,7 @@ specstream rows --find-id FIND_ID
113
173
 
114
174
  ## Pricing
115
175
 
116
- New accounts start with $10 of credit for 30 days, no card. A delivered result costs 5 cents, 15 cents or $1 depending on how many facts it carries. No result, no charge. Rechecks cost half. People and agents share one balance. See [pricing](https://specstream.ai/pricing).
176
+ New accounts start with $10 of credit, no card. A delivered result costs 5 cents, 15 cents or $1 depending on how many facts it carries. No result, no charge. Rechecks cost half. People and agents share one balance. See [pricing](https://specstream.ai/pricing).
117
177
 
118
178
  ## Links
119
179
 
@@ -23,6 +23,66 @@ Create an API key under **Agents & API** in your SpecStream workspace and keep i
23
23
  export SPECSTREAM_API_KEY="ss_live_..."
24
24
  ```
25
25
 
26
+ ## Search the web
27
+
28
+ `web_search` calls the [Search API](https://specstream.ai/docs/search-api), `GET /v1/web-search`, at $5 per 1,000 searches of up to 10 results.
29
+
30
+ ```python
31
+ import os
32
+ from specstream_client import Client
33
+
34
+ client = Client(os.environ["SPECSTREAM_API_KEY"])
35
+
36
+ search = client.web_search(q="What is the population of Japan?")
37
+ for source in search["sources"][:1]:
38
+ print(source["title"], source["url"], source["snippet"])
39
+ ```
40
+
41
+ ## Extract pages
42
+
43
+ `extract_pages` calls the [Extract API](https://specstream.ai/docs/extract-api), `POST /v1/extract`, at $0.80 per 1,000 pages, and a page with no text is not charged.
44
+
45
+ ```python
46
+ import os
47
+ from specstream_client import Client
48
+
49
+ client = Client(os.environ["SPECSTREAM_API_KEY"])
50
+
51
+ extract = client.extract_pages({"urls": ["https://example.com"]})
52
+ for page in extract["results"][:1]:
53
+ print(page["title"], page["url"], page["text"])
54
+ ```
55
+
56
+ ## Drop-in for the API you already call
57
+
58
+ SpecStream answers calls written for these search APIs at its own address, in each API's own reply shape. To switch, change the base address and the key. Each search call is one Search API web search on your SpecStream key: $0.005 for up to 10 results ($5 per 1,000 searches), and each 10 results more in the same call add $0.006.
59
+
60
+ | API you call | Base address you have | SpecStream address | Where the SpecStream key goes |
61
+ | --- | --- | --- | --- |
62
+ | Tavily | `https://api.tavily.com` | `https://api.specstream.ai/tavily` | Bearer token or `api_key` |
63
+ | Exa | `https://api.exa.ai` | `https://api.specstream.ai/exa` | `x-api-key` or Bearer token |
64
+ | Brave Search API | `https://api.search.brave.com` | `https://api.specstream.ai` | `X-Subscription-Token` |
65
+ | Serper | `https://google.serper.dev` | `https://api.specstream.ai/serper` | `X-API-KEY` |
66
+ | Bing Web Search API v7 | `https://api.bing.microsoft.com/v7.0/search` | `https://api.specstream.ai/v7.0/search` | `Ocp-Apim-Subscription-Key` |
67
+ | Google Custom Search JSON API | `https://www.googleapis.com` or `https://customsearch.googleapis.com` | `https://api.specstream.ai` | `key=` (`cx` is accepted and not used) |
68
+ | SearXNG (JSON) | your instance address | `https://api.specstream.ai/searxng/<key>` | in the address, `key=`, `X-API-Key` or Bearer token |
69
+ | Firecrawl v2 | `https://api.firecrawl.dev` | `https://api.specstream.ai/firecrawl` | Bearer token |
70
+
71
+ The official Tavily and Exa Python SDKs take the address as an argument:
72
+
73
+ ```python
74
+ import os
75
+ from tavily import TavilyClient
76
+ from exa_py import Exa
77
+
78
+ tavily = TavilyClient(api_key=os.environ["SPECSTREAM_API_KEY"], api_base_url="https://api.specstream.ai/tavily")
79
+ exa = Exa(api_key=os.environ["SPECSTREAM_API_KEY"], base_url="https://api.specstream.ai/exa")
80
+ ```
81
+
82
+ - A Brave call that sends no `count` is priced as 20 results ($0.011). Send `count=10` for $0.005.
83
+ - A Firecrawl `/v2/scrape` call is one Extract API page at $0.0008. The Firecrawl JavaScript SDK works with this address; the Firecrawl Python SDK does not yet.
84
+ - Each route's request and reply fields: [specstream.ai/agents.md](https://specstream.ai/agents.md). Create a key under **Agents & API** at [specstream.ai/workspace](https://specstream.ai/workspace). New accounts start with $10 of credit, no card.
85
+
26
86
  ## Read a request, get the price
27
87
 
28
88
  ```python
@@ -86,7 +146,7 @@ specstream rows --find-id FIND_ID
86
146
 
87
147
  ## Pricing
88
148
 
89
- New accounts start with $10 of credit for 30 days, no card. A delivered result costs 5 cents, 15 cents or $1 depending on how many facts it carries. No result, no charge. Rechecks cost half. People and agents share one balance. See [pricing](https://specstream.ai/pricing).
149
+ New accounts start with $10 of credit, no card. A delivered result costs 5 cents, 15 cents or $1 depending on how many facts it carries. No result, no charge. Rechecks cost half. People and agents share one balance. See [pricing](https://specstream.ai/pricing).
90
150
 
91
151
  ## Links
92
152
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "specstream-client"
3
- version = "1.3.2"
3
+ version = "1.3.3"
4
4
  description = "Python client for building lead lists and company lists from the live web. Every match comes with its source, priced before it runs."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -11,4 +11,4 @@ __all__ = [
11
11
  "SpecstreamError",
12
12
  "assert_family",
13
13
  ]
14
- __version__ = "1.3.2"
14
+ __version__ = "1.3.3"
@@ -18,7 +18,7 @@ from specstream_client.authorization import require_work_authorization
18
18
  from specstream_client.families import FAMILIES
19
19
 
20
20
  DEFAULT_BASE_URL = "https://api.specstream.ai"
21
- USER_AGENT = "specstream-python/1.3.2"
21
+ USER_AGENT = "specstream-python/1.3.3"
22
22
 
23
23
  OpenFn = Callable[[urllib.request.Request, float], Any]
24
24
 
@@ -296,7 +296,7 @@ class Client:
296
296
 
297
297
  def web_search(self, *, q: str, passages: bool | None = None) -> dict[str, Any]:
298
298
  """
299
- Fast search: answer a question from the live web in seconds, each value with its source.
299
+ Search API: answer a question from the live web in seconds, each value with its source.
300
300
  """
301
301
  path = "/v1/web-search"
302
302
  query: dict[str, Any] = {
@@ -316,8 +316,9 @@ class Client:
316
316
 
317
317
  def extract_pages(self, request: dict[str, Any]) -> dict[str, Any]:
318
318
  """
319
- Read up to 20 pages live: each page's main text as Markdown or plain text, its title and
320
- its published date. Only a page read is charged.
319
+ Extract API: read up to 20 pages, live from their URLs or from HTML you send, each
320
+ page's main text as Markdown or plain text, its title and its published date. Only a
321
+ page read is charged.
321
322
  """
322
323
  path = "/v1/extract"
323
324
  return self._request("POST", path, request)
@@ -33,16 +33,16 @@ COMMANDS = {'get-vocabulary': {'method': 'get_vocabulary',
33
33
  'body': False,
34
34
  'body_required': False,
35
35
  'query': {'q': 'string', 'passages': 'boolean'},
36
- 'summary': 'Fast search: answer a question from the live web in seconds, each '
37
- 'value with its source'},
36
+ 'summary': 'Search API: answer a question from the live web in seconds, each value '
37
+ 'with its source'},
38
38
  'extract-pages': {'method': 'extract_pages',
39
39
  'arguments': [],
40
40
  'body': True,
41
41
  'body_required': True,
42
42
  'query': {},
43
- 'summary': "Read up to 20 pages live: each page's main text as Markdown or "
44
- 'plain text, its title and its published date. Only a page read is '
45
- 'charged'},
43
+ 'summary': 'Extract API: read up to 20 pages, live from their URLs or from HTML '
44
+ "you send, each page's main text as Markdown or plain text, its "
45
+ 'title and its published date. Only a page read is charged'},
46
46
  'web-search-answers': {'method': 'web_search_answers',
47
47
  'arguments': [],
48
48
  'body': False,