search1api 0.2.0__tar.gz → 0.2.1__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,8 +1,9 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: search1api
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Official Python client for Search1API
5
- Project-URL: Documentation, https://www.search1api.com/docs/integrations/sdks
5
+ Project-URL: Homepage, https://s1.dev
6
+ Project-URL: Documentation, https://s1.dev/docs/integrations/sdks
6
7
  Project-URL: Repository, https://github.com/superagents-lab/search1api-python
7
8
  Project-URL: Issues, https://github.com/superagents-lab/search1api-python/issues
8
9
  Author: Search1API
@@ -52,7 +53,7 @@ Description-Content-Type: text/markdown
52
53
 
53
54
  Official synchronous and asynchronous Python clients for Search1API.
54
55
 
55
- API documentation: [search1api.com/docs](https://www.search1api.com/docs)
56
+ API documentation: [search1api.com/docs](https://s1.dev/docs)
56
57
 
57
58
  ## Install
58
59
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Official synchronous and asynchronous Python clients for Search1API.
4
4
 
5
- API documentation: [search1api.com/docs](https://www.search1api.com/docs)
5
+ API documentation: [search1api.com/docs](https://s1.dev/docs)
6
6
 
7
7
  ## Install
8
8
 
@@ -229,7 +229,7 @@
229
229
  },
230
230
  "enableFallback": {
231
231
  "type": "boolean",
232
- "default": false
232
+ "default": true
233
233
  }
234
234
  },
235
235
  "required": [
@@ -779,9 +779,24 @@
779
779
  "post": {
780
780
  "operationId": "screenshot",
781
781
  "summary": "Render a web page as a PNG, JPEG, or WebP image",
782
+ "description": "Render a public webpage as a PNG, JPEG, or WebP image. Use it when appearance is the point — layout checks, visual previews, or content that does not survive text extraction — and control the viewport, when the page counts as ready, and whether to capture the full document or a single element by CSS selector. When you want the page's text instead, call POST /crawl. Costs 2 credits per request.",
782
783
  "tags": [
783
784
  "Screenshot"
784
785
  ],
786
+ "x-codeSamples": [
787
+ {
788
+ "id": "js",
789
+ "lang": "ts",
790
+ "label": "TypeScript SDK",
791
+ "source": "import { writeFile } from 'node:fs/promises';\nimport { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst screenshot = await client.screenshot('https://example.com', {\n format: 'png',\n fullPage: true,\n});\n\nawait writeFile('screenshot.png', screenshot.data);"
792
+ },
793
+ {
794
+ "id": "python",
795
+ "lang": "python",
796
+ "label": "Python SDK",
797
+ "source": "from pathlib import Path\nfrom search1api import Search1API\n\nclient = Search1API()\nscreenshot = client.screenshot(\n \"https://example.com\",\n format=\"png\",\n full_page=True,\n)\n\nPath(\"screenshot.png\").write_bytes(screenshot[\"data\"])"
798
+ }
799
+ ],
785
800
  "responses": {
786
801
  "200": {
787
802
  "description": "Successful response",
@@ -836,6 +851,16 @@
836
851
  }
837
852
  }
838
853
  },
854
+ "403": {
855
+ "description": "Forbidden",
856
+ "content": {
857
+ "application/json": {
858
+ "schema": {
859
+ "$ref": "#/components/schemas/ApiError"
860
+ }
861
+ }
862
+ }
863
+ },
839
864
  "422": {
840
865
  "description": "Validation Error",
841
866
  "content": {
@@ -1024,6 +1049,46 @@
1024
1049
  "url"
1025
1050
  ],
1026
1051
  "additionalProperties": false
1052
+ },
1053
+ "examples": {
1054
+ "fullPage": {
1055
+ "summary": "Full-page PNG",
1056
+ "description": "Capture the complete document after the load event and a short stabilization delay.",
1057
+ "value": {
1058
+ "url": "https://s1.dev",
1059
+ "format": "png",
1060
+ "full_page": true,
1061
+ "wait_until": "load",
1062
+ "delay_ms": 1000,
1063
+ "timeout_ms": 30000
1064
+ }
1065
+ },
1066
+ "element": {
1067
+ "summary": "Page element as WebP",
1068
+ "description": "Wait for one visible element and return only that element as a compressed WebP image.",
1069
+ "value": {
1070
+ "url": "https://example.com",
1071
+ "format": "webp",
1072
+ "selector": "h1",
1073
+ "wait_for_selector": "h1",
1074
+ "quality": 85
1075
+ }
1076
+ },
1077
+ "darkViewport": {
1078
+ "summary": "Dark-mode viewport",
1079
+ "description": "Capture a high-density 1280 × 720 viewport with dark color-scheme emulation.",
1080
+ "value": {
1081
+ "url": "https://s1.dev",
1082
+ "format": "jpeg",
1083
+ "viewport": {
1084
+ "width": 1280,
1085
+ "height": 720,
1086
+ "device_scale_factor": 2
1087
+ },
1088
+ "color_scheme": "dark",
1089
+ "quality": 85
1090
+ }
1091
+ }
1027
1092
  }
1028
1093
  }
1029
1094
  }
@@ -1034,9 +1099,24 @@
1034
1099
  "post": {
1035
1100
  "operationId": "search",
1036
1101
  "summary": "Search the web using multiple search engines",
1102
+ "description": "Search the live public web when the answer depends on current information, sources, or research a model's training data cannot cover. Returns ranked results with id, title, URL, and snippet across 13+ engines, with optional images. Set `crawl_results` to pull the top N result pages in the same call — each crawled page is billed as an additional crawl — or pass a result URL to POST /crawl separately. Costs 1 credit per request.",
1037
1103
  "tags": [
1038
1104
  "Search"
1039
1105
  ],
1106
+ "x-codeSamples": [
1107
+ {
1108
+ "id": "js",
1109
+ "lang": "ts",
1110
+ "label": "TypeScript SDK",
1111
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.search('latest AI agent frameworks', {\n maxResults: 10,\n});\n\nconsole.log(response.results);"
1112
+ },
1113
+ {
1114
+ "id": "python",
1115
+ "lang": "python",
1116
+ "label": "Python SDK",
1117
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nresponse = client.search(\n \"latest AI agent frameworks\",\n max_results=10,\n)\n\nprint(response[\"results\"])"
1118
+ }
1119
+ ],
1040
1120
  "responses": {
1041
1121
  "200": {
1042
1122
  "description": "Successful response",
@@ -1085,16 +1165,6 @@
1085
1165
  }
1086
1166
  }
1087
1167
  },
1088
- "404": {
1089
- "description": "Not Found",
1090
- "content": {
1091
- "application/json": {
1092
- "schema": {
1093
- "$ref": "#/components/schemas/ApiError"
1094
- }
1095
- }
1096
- }
1097
- },
1098
1168
  "422": {
1099
1169
  "description": "Validation Error",
1100
1170
  "content": {
@@ -1146,7 +1216,7 @@
1146
1216
  "mpp"
1147
1217
  ],
1148
1218
  "pricingMode": "fixed",
1149
- "price": "0.003000"
1219
+ "price": "0.003"
1150
1220
  },
1151
1221
  "requestBody": {
1152
1222
  "required": true,
@@ -1327,9 +1397,24 @@
1327
1397
  "post": {
1328
1398
  "operationId": "news",
1329
1399
  "summary": "Search news articles across multiple sources",
1400
+ "description": "Search recent news when the question is about events, announcements, or coverage rather than reference material. Returns articles from verified publishers with title, URL, snippet, and optional full page content, filterable by site, language, and time range. For questions that are not time-sensitive, prefer POST /search. Costs 1 credit per request.",
1330
1401
  "tags": [
1331
1402
  "Search"
1332
1403
  ],
1404
+ "x-codeSamples": [
1405
+ {
1406
+ "id": "js",
1407
+ "lang": "ts",
1408
+ "label": "TypeScript SDK",
1409
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.news('latest AI industry news', {\n maxResults: 10,\n});\n\nconsole.log(response.results);"
1410
+ },
1411
+ {
1412
+ "id": "python",
1413
+ "lang": "python",
1414
+ "label": "Python SDK",
1415
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nresponse = client.news(\n \"latest AI industry news\",\n max_results=10,\n)\n\nprint(response[\"results\"])"
1416
+ }
1417
+ ],
1333
1418
  "responses": {
1334
1419
  "200": {
1335
1420
  "description": "Successful response",
@@ -1378,16 +1463,6 @@
1378
1463
  }
1379
1464
  }
1380
1465
  },
1381
- "404": {
1382
- "description": "Not Found",
1383
- "content": {
1384
- "application/json": {
1385
- "schema": {
1386
- "$ref": "#/components/schemas/ApiError"
1387
- }
1388
- }
1389
- }
1390
- },
1391
1466
  "422": {
1392
1467
  "description": "Validation Error",
1393
1468
  "content": {
@@ -1439,7 +1514,7 @@
1439
1514
  "mpp"
1440
1515
  ],
1441
1516
  "pricingMode": "fixed",
1442
- "price": "0.003000"
1517
+ "price": "0.003"
1443
1518
  },
1444
1519
  "requestBody": {
1445
1520
  "required": true,
@@ -1598,9 +1673,24 @@
1598
1673
  "post": {
1599
1674
  "operationId": "crawl",
1600
1675
  "summary": "Crawl a URL and extract its content",
1676
+ "description": "Fetch one public URL and return its readable title and body as clean text, with navigation, boilerplate, and scripts stripped. Use it on a URL the user supplied or one returned by POST /search. To ingest a whole site rather than a single page, use POST /deepcrawl. Costs 1 credit per request.",
1601
1677
  "tags": [
1602
1678
  "Crawl"
1603
1679
  ],
1680
+ "x-codeSamples": [
1681
+ {
1682
+ "id": "js",
1683
+ "lang": "ts",
1684
+ "label": "TypeScript SDK",
1685
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.crawl('https://example.com');\n\nconsole.log(response);"
1686
+ },
1687
+ {
1688
+ "id": "python",
1689
+ "lang": "python",
1690
+ "label": "Python SDK",
1691
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nresponse = client.crawl(\"https://example.com\")\n\nprint(response)"
1692
+ }
1693
+ ],
1604
1694
  "responses": {
1605
1695
  "200": {
1606
1696
  "description": "Successful response",
@@ -1703,7 +1793,7 @@
1703
1793
  "mpp"
1704
1794
  ],
1705
1795
  "pricingMode": "fixed",
1706
- "price": "0.003000"
1796
+ "price": "0.003"
1707
1797
  },
1708
1798
  "requestBody": {
1709
1799
  "required": true,
@@ -1721,7 +1811,7 @@
1721
1811
  },
1722
1812
  "enableFallback": {
1723
1813
  "type": "boolean",
1724
- "default": false
1814
+ "default": true
1725
1815
  }
1726
1816
  },
1727
1817
  "required": [
@@ -1741,7 +1831,7 @@
1741
1831
  },
1742
1832
  "enableFallback": {
1743
1833
  "type": "boolean",
1744
- "default": false
1834
+ "default": true
1745
1835
  }
1746
1836
  },
1747
1837
  "required": [
@@ -1762,9 +1852,24 @@
1762
1852
  "post": {
1763
1853
  "operationId": "sitemap",
1764
1854
  "summary": "Extract sitemap URLs from a website",
1855
+ "description": "Discover the public URLs of a site when you need to know which pages exist before fetching any of them — scoping a crawl, auditing coverage, or locating a section. Returns the links discovered for the given page or domain; it does not fetch their content. Costs 1 credit per request.",
1765
1856
  "tags": [
1766
1857
  "Crawl"
1767
1858
  ],
1859
+ "x-codeSamples": [
1860
+ {
1861
+ "id": "js",
1862
+ "lang": "ts",
1863
+ "label": "TypeScript SDK",
1864
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.sitemap('https://example.com');\n\nconsole.log(response);"
1865
+ },
1866
+ {
1867
+ "id": "python",
1868
+ "lang": "python",
1869
+ "label": "Python SDK",
1870
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nresponse = client.sitemap(\"https://example.com\")\n\nprint(response)"
1871
+ }
1872
+ ],
1768
1873
  "responses": {
1769
1874
  "200": {
1770
1875
  "description": "Successful response",
@@ -1857,7 +1962,7 @@
1857
1962
  "mpp"
1858
1963
  ],
1859
1964
  "pricingMode": "fixed",
1860
- "price": "0.003000"
1965
+ "price": "0.003"
1861
1966
  },
1862
1967
  "requestBody": {
1863
1968
  "required": true,
@@ -1892,9 +1997,24 @@
1892
1997
  "post": {
1893
1998
  "operationId": "trending",
1894
1999
  "summary": "Get trending topics from various platforms",
2000
+ "description": "List what is currently popular on a supported platform, such as GitHub repositories or Hacker News stories, when the user asks what is trending or new right now. This reads a platform's own live ranking rather than performing a query — for topic searches use POST /search. Costs 1 credit per request.",
1895
2001
  "tags": [
1896
2002
  "Search"
1897
2003
  ],
2004
+ "x-codeSamples": [
2005
+ {
2006
+ "id": "js",
2007
+ "lang": "ts",
2008
+ "label": "TypeScript SDK",
2009
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.trending('github', {\n maxResults: 10,\n});\n\nconsole.log(response);"
2010
+ },
2011
+ {
2012
+ "id": "python",
2013
+ "lang": "python",
2014
+ "label": "Python SDK",
2015
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nresponse = client.trending(\"github\", max_results=10)\n\nprint(response)"
2016
+ }
2017
+ ],
1898
2018
  "responses": {
1899
2019
  "200": {
1900
2020
  "description": "Successful response",
@@ -1987,7 +2107,7 @@
1987
2107
  "mpp"
1988
2108
  ],
1989
2109
  "pricingMode": "fixed",
1990
- "price": "0.003000"
2110
+ "price": "0.003"
1991
2111
  },
1992
2112
  "requestBody": {
1993
2113
  "required": true,
@@ -2019,9 +2139,24 @@
2019
2139
  "post": {
2020
2140
  "operationId": "extract",
2021
2141
  "summary": "Extract structured content from a URL",
2142
+ "description": "Pull structured data out of a single webpage using a natural-language prompt and a JSON schema you supply. Use it when you need specific fields — prices, specifications, contact details — rather than the whole document; when you want the full text, use POST /crawl. Costs 10 credits per request.",
2022
2143
  "tags": [
2023
2144
  "Crawl"
2024
2145
  ],
2146
+ "x-codeSamples": [
2147
+ {
2148
+ "id": "js",
2149
+ "lang": "ts",
2150
+ "label": "TypeScript SDK",
2151
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.extract('https://example.com', {\n prompt: 'Extract the page title and description.',\n});\n\nconsole.log(response);"
2152
+ },
2153
+ {
2154
+ "id": "python",
2155
+ "lang": "python",
2156
+ "label": "Python SDK",
2157
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nresponse = client.extract(\n \"https://example.com\",\n prompt=\"Extract the page title and description.\",\n)\n\nprint(response)"
2158
+ }
2159
+ ],
2025
2160
  "responses": {
2026
2161
  "200": {
2027
2162
  "description": "Successful response",
@@ -2114,7 +2249,7 @@
2114
2249
  "mpp"
2115
2250
  ],
2116
2251
  "pricingMode": "fixed",
2117
- "price": "0.030000"
2252
+ "price": "0.03"
2118
2253
  },
2119
2254
  "requestBody": {
2120
2255
  "required": true,
@@ -2149,9 +2284,24 @@
2149
2284
  "post": {
2150
2285
  "operationId": "deepcrawl",
2151
2286
  "summary": "Deep crawl a website across multiple pages",
2287
+ "description": "Start an asynchronous crawl of an entire site and package the pages as documents. Use it for whole-site ingestion; a single page is POST /crawl. The call returns a task id immediately rather than the result — poll GET /deepcrawl/status/{taskId} until the task reports completion. Costs 20 credits per request.",
2152
2288
  "tags": [
2153
2289
  "Crawl"
2154
2290
  ],
2291
+ "x-codeSamples": [
2292
+ {
2293
+ "id": "js",
2294
+ "lang": "ts",
2295
+ "label": "TypeScript SDK",
2296
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst task = await client.startDeepcrawl('https://example.com', {\n type: 'all',\n});\n\nconsole.log(task.taskId);"
2297
+ },
2298
+ {
2299
+ "id": "python",
2300
+ "lang": "python",
2301
+ "label": "Python SDK",
2302
+ "source": "from search1api import Search1API\n\nclient = Search1API()\ntask = client.start_deepcrawl(\"https://example.com\", type=\"all\")\n\nprint(task[\"taskId\"])"
2303
+ }
2304
+ ],
2155
2305
  "responses": {
2156
2306
  "202": {
2157
2307
  "description": "Successful response",
@@ -2244,7 +2394,7 @@
2244
2394
  "mpp"
2245
2395
  ],
2246
2396
  "pricingMode": "fixed",
2247
- "price": "0.060000"
2397
+ "price": "0.06"
2248
2398
  },
2249
2399
  "requestBody": {
2250
2400
  "required": true,
@@ -2279,9 +2429,24 @@
2279
2429
  "get": {
2280
2430
  "operationId": "deepcrawlStatus",
2281
2431
  "summary": "Check deepcrawl task status",
2432
+ "description": "Poll a deepcrawl task started by POST /deepcrawl. Returns the task's current state and, once it finishes, where to retrieve the packaged result. Safe to call repeatedly. Free to call.",
2282
2433
  "tags": [
2283
2434
  "Crawl"
2284
2435
  ],
2436
+ "x-codeSamples": [
2437
+ {
2438
+ "id": "js",
2439
+ "lang": "ts",
2440
+ "label": "TypeScript SDK",
2441
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst status = await client.getDeepcrawlStatus('task_id');\n\nconsole.log(status);"
2442
+ },
2443
+ {
2444
+ "id": "python",
2445
+ "lang": "python",
2446
+ "label": "Python SDK",
2447
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nstatus = client.get_deepcrawl_status(\"task_id\")\n\nprint(status)"
2448
+ }
2449
+ ],
2285
2450
  "responses": {
2286
2451
  "200": {
2287
2452
  "description": "Successful response",
@@ -2356,9 +2521,24 @@
2356
2521
  "get": {
2357
2522
  "operationId": "health",
2358
2523
  "summary": "Health check",
2524
+ "description": "Report whether the API is serving traffic. Takes no credentials, so use it for uptime and readiness checks — it will not tell you whether an API key is valid; call GET /usage for that. Free to call.",
2359
2525
  "tags": [
2360
2526
  "System"
2361
2527
  ],
2528
+ "x-codeSamples": [
2529
+ {
2530
+ "id": "js",
2531
+ "lang": "ts",
2532
+ "label": "TypeScript SDK",
2533
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst health = await client.health();\n\nconsole.log(health);"
2534
+ },
2535
+ {
2536
+ "id": "python",
2537
+ "lang": "python",
2538
+ "label": "Python SDK",
2539
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nhealth = client.health()\n\nprint(health)"
2540
+ }
2541
+ ],
2362
2542
  "responses": {
2363
2543
  "200": {
2364
2544
  "description": "Successful response",
@@ -2387,9 +2567,24 @@
2387
2567
  "get": {
2388
2568
  "operationId": "usage",
2389
2569
  "summary": "Get API key usage statistics",
2570
+ "description": "Return the remaining credit balance for the authenticated account. Use it to check headroom before starting an expensive job such as a deepcrawl, or to confirm an API key works. Free to call.",
2390
2571
  "tags": [
2391
2572
  "Account"
2392
2573
  ],
2574
+ "x-codeSamples": [
2575
+ {
2576
+ "id": "js",
2577
+ "lang": "ts",
2578
+ "label": "TypeScript SDK",
2579
+ "source": "import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst usage = await client.usage('month');\n\nconsole.log(usage);"
2580
+ },
2581
+ {
2582
+ "id": "python",
2583
+ "lang": "python",
2584
+ "label": "Python SDK",
2585
+ "source": "from search1api import Search1API\n\nclient = Search1API()\nusage = client.usage(\"month\")\n\nprint(usage)"
2586
+ }
2587
+ ],
2393
2588
  "responses": {
2394
2589
  "200": {
2395
2590
  "description": "Successful response",
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "search1api"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Official Python client for Search1API"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -33,7 +33,8 @@ dev = [
33
33
  ]
34
34
 
35
35
  [project.urls]
36
- Documentation = "https://www.search1api.com/docs/integrations/sdks"
36
+ Homepage = "https://s1.dev"
37
+ Documentation = "https://s1.dev/docs/integrations/sdks"
37
38
  Repository = "https://github.com/superagents-lab/search1api-python"
38
39
  Issues = "https://github.com/superagents-lab/search1api-python/issues"
39
40
 
@@ -35,4 +35,4 @@ __all__ = [
35
35
  "UnprocessableEntityError",
36
36
  ]
37
37
 
38
- __version__ = "0.2.0"
38
+ __version__ = "0.2.1"
File without changes
File without changes
File without changes