getanyapi 0.1.0__py3-none-any.whl
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.
- getanyapi/__init__.py +76 -0
- getanyapi/_account.py +132 -0
- getanyapi/_async_client.py +215 -0
- getanyapi/_client.py +274 -0
- getanyapi/_errors.py +115 -0
- getanyapi/_pagination.py +295 -0
- getanyapi/_transport.py +239 -0
- getanyapi/platforms/__init__.py +89 -0
- getanyapi/platforms/ahrefs.py +384 -0
- getanyapi/platforms/airbnb.py +120 -0
- getanyapi/platforms/alibaba.py +95 -0
- getanyapi/platforms/amazon.py +442 -0
- getanyapi/platforms/appstore.py +95 -0
- getanyapi/platforms/bluesky.py +215 -0
- getanyapi/platforms/booking.py +128 -0
- getanyapi/platforms/coinmarketcap.py +113 -0
- getanyapi/platforms/congress.py +106 -0
- getanyapi/platforms/dexscreener.py +104 -0
- getanyapi/platforms/ebay.py +215 -0
- getanyapi/platforms/email.py +166 -0
- getanyapi/platforms/facebook.py +2324 -0
- getanyapi/platforms/fiverr.py +122 -0
- getanyapi/platforms/github.py +954 -0
- getanyapi/platforms/glassdoor.py +93 -0
- getanyapi/platforms/google.py +232 -0
- getanyapi/platforms/google_ads.py +380 -0
- getanyapi/platforms/google_finance.py +170 -0
- getanyapi/platforms/google_shopping.py +103 -0
- getanyapi/platforms/hackernews.py +276 -0
- getanyapi/platforms/indeed.py +114 -0
- getanyapi/platforms/instagram.py +1868 -0
- getanyapi/platforms/linkedin.py +1064 -0
- getanyapi/platforms/maps.py +412 -0
- getanyapi/platforms/pandaexpress.py +262 -0
- getanyapi/platforms/person.py +96 -0
- getanyapi/platforms/pinterest.py +96 -0
- getanyapi/platforms/playstore.py +99 -0
- getanyapi/platforms/polymarket.py +109 -0
- getanyapi/platforms/realtor.py +104 -0
- getanyapi/platforms/reddit.py +582 -0
- getanyapi/platforms/redfin.py +95 -0
- getanyapi/platforms/rednote.py +807 -0
- getanyapi/platforms/sec.py +118 -0
- getanyapi/platforms/semrush.py +358 -0
- getanyapi/platforms/snapchat.py +146 -0
- getanyapi/platforms/social.py +105 -0
- getanyapi/platforms/spotify.py +588 -0
- getanyapi/platforms/substack.py +142 -0
- getanyapi/platforms/threads.py +358 -0
- getanyapi/platforms/tiktok.py +1827 -0
- getanyapi/platforms/tiktok_shop.py +536 -0
- getanyapi/platforms/tripadvisor.py +180 -0
- getanyapi/platforms/trustpilot.py +114 -0
- getanyapi/platforms/truthsocial.py +226 -0
- getanyapi/platforms/twitter.py +798 -0
- getanyapi/platforms/upwork.py +119 -0
- getanyapi/platforms/walmart.py +93 -0
- getanyapi/platforms/web.py +264 -0
- getanyapi/platforms/whatsapp.py +91 -0
- getanyapi/platforms/yahoo_finance.py +95 -0
- getanyapi/platforms/yelp.py +141 -0
- getanyapi/platforms/youtube.py +1452 -0
- getanyapi/platforms/zillow.py +218 -0
- getanyapi/py.typed +0 -0
- getanyapi/types.py +170 -0
- getanyapi-0.1.0.dist-info/METADATA +155 -0
- getanyapi-0.1.0.dist-info/RECORD +68 -0
- getanyapi-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the google_finance platform."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
from typing_extensions import Required, TypedDict, Unpack
|
|
10
|
+
|
|
11
|
+
from ..types import RequestOptions, RunResult
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from .._async_client import AsyncAnyAPI
|
|
15
|
+
from .._client import AnyAPI
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class GoogleFinanceQuoteInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Google Finance Quote."""
|
|
20
|
+
|
|
21
|
+
symbol: Required[str]
|
|
22
|
+
"""The symbol to quote. US stocks use a plain ticker (e.g. AAPL, TSLA); non-US stocks add a market suffix (e.g. VOW3.DE, BABA.HK, BARC.L); indices use a caret (e.g. ^GSPC, ^DJI); crypto and currencies use pair form (e.g. BTC-USD, EURUSD=X); mutual funds and futures use their symbol (e.g. VFIAX, ES=F). Common alternate forms are accepted and normalized (e.g. AAPL:NASDAQ, .DJI, BTC/USD). Exact symbols only, not a company-name search."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class GoogleFinanceQuoteData(BaseModel):
|
|
26
|
+
items: list[GoogleFinanceQuoteItem] = Field(
|
|
27
|
+
description="The quote for the requested symbol: name, current price, day change (absolute and percent), quote currency, exchange and market state, plus intraday and reference figures. Up to one element (empty when the symbol did not resolve)."
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class GoogleFinanceQuoteItem(BaseModel):
|
|
32
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
33
|
+
|
|
34
|
+
ask: float | None = Field(default=None, description="Current ask price.")
|
|
35
|
+
asset_type: str | None = Field(
|
|
36
|
+
default=None,
|
|
37
|
+
alias="assetType",
|
|
38
|
+
description="Instrument class (e.g. EQUITY, ETF, CRYPTOCURRENCY, CURRENCY, INDEX, MUTUALFUND, FUTURE).",
|
|
39
|
+
)
|
|
40
|
+
average_volume: float | None = Field(
|
|
41
|
+
default=None, alias="averageVolume", description="Average daily trading volume."
|
|
42
|
+
)
|
|
43
|
+
bid: float | None = Field(default=None, description="Current bid price.")
|
|
44
|
+
change: float | None = Field(
|
|
45
|
+
default=None,
|
|
46
|
+
description="Absolute price change on the day, in the quote currency.",
|
|
47
|
+
)
|
|
48
|
+
change_percent: float | None = Field(
|
|
49
|
+
default=None,
|
|
50
|
+
alias="changePercent",
|
|
51
|
+
description="Percent price change on the day.",
|
|
52
|
+
)
|
|
53
|
+
currency: str | None = Field(
|
|
54
|
+
default=None,
|
|
55
|
+
description="ISO currency the quote is priced in (e.g. USD). Present whenever the upstream returns this record.",
|
|
56
|
+
)
|
|
57
|
+
day_high: float | None = Field(
|
|
58
|
+
default=None,
|
|
59
|
+
alias="dayHigh",
|
|
60
|
+
description="Highest price so far in the current session.",
|
|
61
|
+
)
|
|
62
|
+
day_low: float | None = Field(
|
|
63
|
+
default=None,
|
|
64
|
+
alias="dayLow",
|
|
65
|
+
description="Lowest price so far in the current session.",
|
|
66
|
+
)
|
|
67
|
+
exchange: str | None = Field(
|
|
68
|
+
default=None,
|
|
69
|
+
description="Exchange the instrument trades on (e.g. NasdaqGS). Present whenever the upstream returns this record.",
|
|
70
|
+
)
|
|
71
|
+
fifty_two_week_high: float | None = Field(
|
|
72
|
+
default=None,
|
|
73
|
+
alias="fiftyTwoWeekHigh",
|
|
74
|
+
description="Highest price over the trailing 52 weeks.",
|
|
75
|
+
)
|
|
76
|
+
fifty_two_week_low: float | None = Field(
|
|
77
|
+
default=None,
|
|
78
|
+
alias="fiftyTwoWeekLow",
|
|
79
|
+
description="Lowest price over the trailing 52 weeks.",
|
|
80
|
+
)
|
|
81
|
+
market_cap: float | None = Field(
|
|
82
|
+
default=None,
|
|
83
|
+
alias="marketCap",
|
|
84
|
+
description="Market capitalization in the quote currency.",
|
|
85
|
+
)
|
|
86
|
+
market_state: str | None = Field(
|
|
87
|
+
default=None,
|
|
88
|
+
alias="marketState",
|
|
89
|
+
description="Current market state (e.g. REGULAR, PRE, POST, CLOSED).",
|
|
90
|
+
)
|
|
91
|
+
name: str | None = Field(
|
|
92
|
+
default=None,
|
|
93
|
+
description="Instrument or company name. Present whenever the upstream returns this record.",
|
|
94
|
+
)
|
|
95
|
+
open: float | None = Field(
|
|
96
|
+
default=None, description="Opening price for the current session."
|
|
97
|
+
)
|
|
98
|
+
previous_close: float | None = Field(
|
|
99
|
+
default=None, alias="previousClose", description="Previous session close price."
|
|
100
|
+
)
|
|
101
|
+
price: float = Field(description="Current price in the quote currency.")
|
|
102
|
+
symbol: str = Field(description="Resolved ticker symbol for the quote.")
|
|
103
|
+
timestamp: str | None = Field(
|
|
104
|
+
default=None, description="Timestamp of the quote (ISO 8601)."
|
|
105
|
+
)
|
|
106
|
+
volume: float | None = Field(
|
|
107
|
+
default=None, description="Traded volume for the current session."
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class GoogleFinanceNamespace:
|
|
112
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
113
|
+
|
|
114
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
115
|
+
self._client = client
|
|
116
|
+
|
|
117
|
+
def quote(
|
|
118
|
+
self,
|
|
119
|
+
*,
|
|
120
|
+
options: RequestOptions | None = None,
|
|
121
|
+
**input: Unpack[GoogleFinanceQuoteInput],
|
|
122
|
+
) -> RunResult[GoogleFinanceQuoteData]:
|
|
123
|
+
"""Google Finance Quote
|
|
124
|
+
|
|
125
|
+
Fetch a live quote for any stock, index, ETF, mutual fund, currency pair, or
|
|
126
|
+
crypto symbol: name, current price, the absolute and percent change on the
|
|
127
|
+
day, quote currency, exchange and market state, plus intraday and reference
|
|
128
|
+
figures (open, day high/low, previous close, volume, market cap, and the
|
|
129
|
+
52-week range) with transparent per-request USD pricing.
|
|
130
|
+
|
|
131
|
+
Price: $0.0005 per request plus $0.0015 per result.
|
|
132
|
+
|
|
133
|
+
Example:
|
|
134
|
+
res = client.google_finance.quote(symbol="AAPL:NASDAQ")
|
|
135
|
+
"""
|
|
136
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
137
|
+
"google_finance.quote", dict(input), options
|
|
138
|
+
)
|
|
139
|
+
return RunResult[GoogleFinanceQuoteData].model_validate(raw)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class AsyncGoogleFinanceNamespace:
|
|
143
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
144
|
+
|
|
145
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
146
|
+
self._client = client
|
|
147
|
+
|
|
148
|
+
async def quote(
|
|
149
|
+
self,
|
|
150
|
+
*,
|
|
151
|
+
options: RequestOptions | None = None,
|
|
152
|
+
**input: Unpack[GoogleFinanceQuoteInput],
|
|
153
|
+
) -> RunResult[GoogleFinanceQuoteData]:
|
|
154
|
+
"""Google Finance Quote
|
|
155
|
+
|
|
156
|
+
Fetch a live quote for any stock, index, ETF, mutual fund, currency pair, or
|
|
157
|
+
crypto symbol: name, current price, the absolute and percent change on the
|
|
158
|
+
day, quote currency, exchange and market state, plus intraday and reference
|
|
159
|
+
figures (open, day high/low, previous close, volume, market cap, and the
|
|
160
|
+
52-week range) with transparent per-request USD pricing.
|
|
161
|
+
|
|
162
|
+
Price: $0.0005 per request plus $0.0015 per result.
|
|
163
|
+
|
|
164
|
+
Example:
|
|
165
|
+
res = client.google_finance.quote(symbol="AAPL:NASDAQ")
|
|
166
|
+
"""
|
|
167
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
168
|
+
"google_finance.quote", dict(input), options
|
|
169
|
+
)
|
|
170
|
+
return RunResult[GoogleFinanceQuoteData].model_validate(raw)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the google_shopping platform."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import Literal, TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
|
|
10
|
+
|
|
11
|
+
from ..types import RequestOptions, RunResult
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from .._async_client import AsyncAnyAPI
|
|
15
|
+
from .._client import AnyAPI
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class GoogleShoppingSearchInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Google Shopping Search."""
|
|
20
|
+
|
|
21
|
+
country: NotRequired[str]
|
|
22
|
+
"""ISO 3166-1 alpha-2 country code for localized results (e.g. "us", "gb", "de"). Default: us."""
|
|
23
|
+
language: NotRequired[str]
|
|
24
|
+
"""ISO 639-1 language code for results (e.g. "en", "es", "fr"). Default: en."""
|
|
25
|
+
limit: NotRequired[int]
|
|
26
|
+
"""Maximum number of results to return (1-10, default 10). You are billed per result returned, so a lower limit costs less. Range: 1 to 10."""
|
|
27
|
+
query: Required[str]
|
|
28
|
+
"""Product name, brand, or keywords to search for (e.g. "Nike running shoes")."""
|
|
29
|
+
sortBy: NotRequired[
|
|
30
|
+
Literal["BEST_MATCH", "LOWEST_PRICE", "HIGHEST_PRICE", "TOP_RATED"]
|
|
31
|
+
]
|
|
32
|
+
"""Sort order for results (e.g. "LOWEST_PRICE"); defaults to relevance."""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class GoogleShoppingSearchData(BaseModel):
|
|
36
|
+
items: list[GoogleShoppingSearchItem] = Field(
|
|
37
|
+
description="Matching product offers: title, price, store name, rating, shipping info, and product link."
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class GoogleShoppingSearchItem(BaseModel):
|
|
42
|
+
model_config = ConfigDict(extra="allow")
|
|
43
|
+
|
|
44
|
+
title: str
|
|
45
|
+
url: str
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class GoogleShoppingNamespace:
|
|
49
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
50
|
+
|
|
51
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
52
|
+
self._client = client
|
|
53
|
+
|
|
54
|
+
def search(
|
|
55
|
+
self,
|
|
56
|
+
*,
|
|
57
|
+
options: RequestOptions | None = None,
|
|
58
|
+
**input: Unpack[GoogleShoppingSearchInput],
|
|
59
|
+
) -> RunResult[GoogleShoppingSearchData]:
|
|
60
|
+
"""Google Shopping Search
|
|
61
|
+
|
|
62
|
+
Search Google Shopping by keyword and get up to 10 product offers - title,
|
|
63
|
+
price, store, rating, and link - localized by country and language, at a
|
|
64
|
+
flat per-request USD price.
|
|
65
|
+
|
|
66
|
+
Price: $0.01625 per request.
|
|
67
|
+
|
|
68
|
+
Example:
|
|
69
|
+
res = client.google_shopping.search(limit=10, query="airpods")
|
|
70
|
+
"""
|
|
71
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
72
|
+
"google_shopping.search", dict(input), options
|
|
73
|
+
)
|
|
74
|
+
return RunResult[GoogleShoppingSearchData].model_validate(raw)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class AsyncGoogleShoppingNamespace:
|
|
78
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
79
|
+
|
|
80
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
81
|
+
self._client = client
|
|
82
|
+
|
|
83
|
+
async def search(
|
|
84
|
+
self,
|
|
85
|
+
*,
|
|
86
|
+
options: RequestOptions | None = None,
|
|
87
|
+
**input: Unpack[GoogleShoppingSearchInput],
|
|
88
|
+
) -> RunResult[GoogleShoppingSearchData]:
|
|
89
|
+
"""Google Shopping Search
|
|
90
|
+
|
|
91
|
+
Search Google Shopping by keyword and get up to 10 product offers - title,
|
|
92
|
+
price, store, rating, and link - localized by country and language, at a
|
|
93
|
+
flat per-request USD price.
|
|
94
|
+
|
|
95
|
+
Price: $0.01625 per request.
|
|
96
|
+
|
|
97
|
+
Example:
|
|
98
|
+
res = client.google_shopping.search(limit=10, query="airpods")
|
|
99
|
+
"""
|
|
100
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
101
|
+
"google_shopping.search", dict(input), options
|
|
102
|
+
)
|
|
103
|
+
return RunResult[GoogleShoppingSearchData].model_validate(raw)
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the hackernews platform."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
|
|
10
|
+
|
|
11
|
+
from ..types import RequestOptions, RunResult
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from .._async_client import AsyncAnyAPI
|
|
15
|
+
from .._client import AnyAPI
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class HackernewsProfileInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Hacker News Profile."""
|
|
20
|
+
|
|
21
|
+
handle: Required[str]
|
|
22
|
+
"""Hacker News username, e.g. "pg"."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class HackernewsSearchInput(TypedDict, total=False):
|
|
26
|
+
"""Input for Hacker News Search."""
|
|
27
|
+
|
|
28
|
+
query: Required[str]
|
|
29
|
+
"""Search keyword, e.g. "ai"."""
|
|
30
|
+
tags: NotRequired[str]
|
|
31
|
+
"""Optional result filter, e.g. "story" or "comment"."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class HackernewsStoryInput(TypedDict, total=False):
|
|
35
|
+
"""Input for Hacker News Story."""
|
|
36
|
+
|
|
37
|
+
id: Required[str]
|
|
38
|
+
"""Hacker News story id, e.g. "47340079"."""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class HackernewsStoryCommentsInput(TypedDict, total=False):
|
|
42
|
+
"""Input for Hacker News Story Comments."""
|
|
43
|
+
|
|
44
|
+
id: Required[str]
|
|
45
|
+
"""Hacker News story id, e.g. "47340079"."""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class HackernewsProfileData(BaseModel):
|
|
49
|
+
model_config = ConfigDict(extra="allow")
|
|
50
|
+
|
|
51
|
+
bio: str
|
|
52
|
+
karma: int
|
|
53
|
+
username: str
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class HackernewsSearchData(BaseModel):
|
|
57
|
+
results: list[HackernewsSearchResult]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class HackernewsSearchResult(BaseModel):
|
|
61
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
62
|
+
|
|
63
|
+
author: str
|
|
64
|
+
comments: int
|
|
65
|
+
id: str
|
|
66
|
+
points: int
|
|
67
|
+
published_at: str = Field(alias="publishedAt")
|
|
68
|
+
title: str
|
|
69
|
+
url: str
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class HackernewsStoryData(BaseModel):
|
|
73
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
74
|
+
|
|
75
|
+
author: str
|
|
76
|
+
comments: int
|
|
77
|
+
points: int
|
|
78
|
+
published_at: str = Field(alias="publishedAt")
|
|
79
|
+
title: str
|
|
80
|
+
url: str
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class HackernewsStoryCommentsData(BaseModel):
|
|
84
|
+
comments: list[HackernewsStoryCommentsComment]
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class HackernewsStoryCommentsComment(BaseModel):
|
|
88
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
89
|
+
|
|
90
|
+
author: str
|
|
91
|
+
id: str
|
|
92
|
+
parent_id: str = Field(alias="parentId")
|
|
93
|
+
published_at: str = Field(alias="publishedAt")
|
|
94
|
+
text: str
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class HackernewsNamespace:
|
|
98
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
99
|
+
|
|
100
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
101
|
+
self._client = client
|
|
102
|
+
|
|
103
|
+
def profile(
|
|
104
|
+
self,
|
|
105
|
+
*,
|
|
106
|
+
options: RequestOptions | None = None,
|
|
107
|
+
**input: Unpack[HackernewsProfileInput],
|
|
108
|
+
) -> RunResult[HackernewsProfileData]:
|
|
109
|
+
"""Hacker News Profile
|
|
110
|
+
|
|
111
|
+
Get a Hacker News user's public profile by username - karma, bio, and
|
|
112
|
+
account details as clean JSON, billed per request in USD.
|
|
113
|
+
|
|
114
|
+
Price: $0.00325 per request.
|
|
115
|
+
|
|
116
|
+
Example:
|
|
117
|
+
res = client.hackernews.profile(handle="pg")
|
|
118
|
+
"""
|
|
119
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
120
|
+
"hackernews.profile", dict(input), options
|
|
121
|
+
)
|
|
122
|
+
return RunResult[HackernewsProfileData].model_validate(raw)
|
|
123
|
+
|
|
124
|
+
def search(
|
|
125
|
+
self,
|
|
126
|
+
*,
|
|
127
|
+
options: RequestOptions | None = None,
|
|
128
|
+
**input: Unpack[HackernewsSearchInput],
|
|
129
|
+
) -> RunResult[HackernewsSearchData]:
|
|
130
|
+
"""Hacker News Search
|
|
131
|
+
|
|
132
|
+
Search Hacker News by keyword - matching stories with title, link, author,
|
|
133
|
+
points, and comment count as clean JSON, billed per request in USD.
|
|
134
|
+
|
|
135
|
+
Price: $0.00325 per request.
|
|
136
|
+
|
|
137
|
+
Example:
|
|
138
|
+
res = client.hackernews.search(query="ai")
|
|
139
|
+
"""
|
|
140
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
141
|
+
"hackernews.search", dict(input), options
|
|
142
|
+
)
|
|
143
|
+
return RunResult[HackernewsSearchData].model_validate(raw)
|
|
144
|
+
|
|
145
|
+
def story(
|
|
146
|
+
self,
|
|
147
|
+
*,
|
|
148
|
+
options: RequestOptions | None = None,
|
|
149
|
+
**input: Unpack[HackernewsStoryInput],
|
|
150
|
+
) -> RunResult[HackernewsStoryData]:
|
|
151
|
+
"""Hacker News Story
|
|
152
|
+
|
|
153
|
+
Get a Hacker News story by id - title, link, author, points, and comment
|
|
154
|
+
count as clean JSON, billed per request in USD.
|
|
155
|
+
|
|
156
|
+
Price: $0.00325 per request.
|
|
157
|
+
|
|
158
|
+
Example:
|
|
159
|
+
res = client.hackernews.story(id="47340079")
|
|
160
|
+
"""
|
|
161
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
162
|
+
"hackernews.story", dict(input), options
|
|
163
|
+
)
|
|
164
|
+
return RunResult[HackernewsStoryData].model_validate(raw)
|
|
165
|
+
|
|
166
|
+
def story_comments(
|
|
167
|
+
self,
|
|
168
|
+
*,
|
|
169
|
+
options: RequestOptions | None = None,
|
|
170
|
+
**input: Unpack[HackernewsStoryCommentsInput],
|
|
171
|
+
) -> RunResult[HackernewsStoryCommentsData]:
|
|
172
|
+
"""Hacker News Story Comments
|
|
173
|
+
|
|
174
|
+
List the comments on a Hacker News story by id - text, author, and timestamp
|
|
175
|
+
as clean JSON, billed per request in USD.
|
|
176
|
+
|
|
177
|
+
Price: $0.00325 per request.
|
|
178
|
+
|
|
179
|
+
Example:
|
|
180
|
+
res = client.hackernews.story_comments(id="47340079")
|
|
181
|
+
"""
|
|
182
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
183
|
+
"hackernews.story_comments", dict(input), options
|
|
184
|
+
)
|
|
185
|
+
return RunResult[HackernewsStoryCommentsData].model_validate(raw)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class AsyncHackernewsNamespace:
|
|
189
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
190
|
+
|
|
191
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
192
|
+
self._client = client
|
|
193
|
+
|
|
194
|
+
async def profile(
|
|
195
|
+
self,
|
|
196
|
+
*,
|
|
197
|
+
options: RequestOptions | None = None,
|
|
198
|
+
**input: Unpack[HackernewsProfileInput],
|
|
199
|
+
) -> RunResult[HackernewsProfileData]:
|
|
200
|
+
"""Hacker News Profile
|
|
201
|
+
|
|
202
|
+
Get a Hacker News user's public profile by username - karma, bio, and
|
|
203
|
+
account details as clean JSON, billed per request in USD.
|
|
204
|
+
|
|
205
|
+
Price: $0.00325 per request.
|
|
206
|
+
|
|
207
|
+
Example:
|
|
208
|
+
res = client.hackernews.profile(handle="pg")
|
|
209
|
+
"""
|
|
210
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
211
|
+
"hackernews.profile", dict(input), options
|
|
212
|
+
)
|
|
213
|
+
return RunResult[HackernewsProfileData].model_validate(raw)
|
|
214
|
+
|
|
215
|
+
async def search(
|
|
216
|
+
self,
|
|
217
|
+
*,
|
|
218
|
+
options: RequestOptions | None = None,
|
|
219
|
+
**input: Unpack[HackernewsSearchInput],
|
|
220
|
+
) -> RunResult[HackernewsSearchData]:
|
|
221
|
+
"""Hacker News Search
|
|
222
|
+
|
|
223
|
+
Search Hacker News by keyword - matching stories with title, link, author,
|
|
224
|
+
points, and comment count as clean JSON, billed per request in USD.
|
|
225
|
+
|
|
226
|
+
Price: $0.00325 per request.
|
|
227
|
+
|
|
228
|
+
Example:
|
|
229
|
+
res = client.hackernews.search(query="ai")
|
|
230
|
+
"""
|
|
231
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
232
|
+
"hackernews.search", dict(input), options
|
|
233
|
+
)
|
|
234
|
+
return RunResult[HackernewsSearchData].model_validate(raw)
|
|
235
|
+
|
|
236
|
+
async def story(
|
|
237
|
+
self,
|
|
238
|
+
*,
|
|
239
|
+
options: RequestOptions | None = None,
|
|
240
|
+
**input: Unpack[HackernewsStoryInput],
|
|
241
|
+
) -> RunResult[HackernewsStoryData]:
|
|
242
|
+
"""Hacker News Story
|
|
243
|
+
|
|
244
|
+
Get a Hacker News story by id - title, link, author, points, and comment
|
|
245
|
+
count as clean JSON, billed per request in USD.
|
|
246
|
+
|
|
247
|
+
Price: $0.00325 per request.
|
|
248
|
+
|
|
249
|
+
Example:
|
|
250
|
+
res = client.hackernews.story(id="47340079")
|
|
251
|
+
"""
|
|
252
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
253
|
+
"hackernews.story", dict(input), options
|
|
254
|
+
)
|
|
255
|
+
return RunResult[HackernewsStoryData].model_validate(raw)
|
|
256
|
+
|
|
257
|
+
async def story_comments(
|
|
258
|
+
self,
|
|
259
|
+
*,
|
|
260
|
+
options: RequestOptions | None = None,
|
|
261
|
+
**input: Unpack[HackernewsStoryCommentsInput],
|
|
262
|
+
) -> RunResult[HackernewsStoryCommentsData]:
|
|
263
|
+
"""Hacker News Story Comments
|
|
264
|
+
|
|
265
|
+
List the comments on a Hacker News story by id - text, author, and timestamp
|
|
266
|
+
as clean JSON, billed per request in USD.
|
|
267
|
+
|
|
268
|
+
Price: $0.00325 per request.
|
|
269
|
+
|
|
270
|
+
Example:
|
|
271
|
+
res = client.hackernews.story_comments(id="47340079")
|
|
272
|
+
"""
|
|
273
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
274
|
+
"hackernews.story_comments", dict(input), options
|
|
275
|
+
)
|
|
276
|
+
return RunResult[HackernewsStoryCommentsData].model_validate(raw)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the indeed platform."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
|
|
10
|
+
|
|
11
|
+
from ..types import RequestOptions, RunResult
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from .._async_client import AsyncAnyAPI
|
|
15
|
+
from .._client import AnyAPI
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class IndeedJobsInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Indeed Jobs."""
|
|
20
|
+
|
|
21
|
+
country: NotRequired[str]
|
|
22
|
+
"""Two-letter country site code (e.g. us, uk, de). Default: us."""
|
|
23
|
+
limit: NotRequired[int]
|
|
24
|
+
"""Maximum number of results to return (1-20, default 20). You are billed per result returned, so a lower limit costs less. Range: 1 to 20."""
|
|
25
|
+
location: NotRequired[str]
|
|
26
|
+
"""City, state, zip, or 'remote'."""
|
|
27
|
+
query: Required[str]
|
|
28
|
+
"""Job search keywords (e.g. software engineer)."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class IndeedJobsData(BaseModel):
|
|
32
|
+
items: list[IndeedJobsItem] = Field(
|
|
33
|
+
description="Job listing records: title, employer, location, salary when available, job type, posting date, and description."
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class IndeedJobsItem(BaseModel):
|
|
38
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
39
|
+
|
|
40
|
+
city: str | None = None
|
|
41
|
+
company: str | None = Field(
|
|
42
|
+
default=None, description="Present whenever the upstream returns this record."
|
|
43
|
+
)
|
|
44
|
+
country: str | None = None
|
|
45
|
+
date_published: str | None = Field(
|
|
46
|
+
default=None, alias="datePublished", description="ISO 8601 publish date."
|
|
47
|
+
)
|
|
48
|
+
description: str | None = Field(
|
|
49
|
+
default=None, description="Plain-text job description."
|
|
50
|
+
)
|
|
51
|
+
expired: bool | None = None
|
|
52
|
+
job_id: str = Field(alias="jobId", description="Indeed job key.")
|
|
53
|
+
postal_code: str | None = Field(default=None, alias="postalCode")
|
|
54
|
+
salary_currency: str | None = Field(default=None, alias="salaryCurrency")
|
|
55
|
+
salary_max: float | None = Field(default=None, alias="salaryMax")
|
|
56
|
+
salary_min: float | None = Field(default=None, alias="salaryMin")
|
|
57
|
+
salary_unit: str | None = Field(
|
|
58
|
+
default=None,
|
|
59
|
+
alias="salaryUnit",
|
|
60
|
+
description="Salary period, e.g. YEAR or HOUR.",
|
|
61
|
+
)
|
|
62
|
+
state: str | None = None
|
|
63
|
+
title: str
|
|
64
|
+
url: str = Field(description="Indeed job posting URL.")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class IndeedNamespace:
|
|
68
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
69
|
+
|
|
70
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
71
|
+
self._client = client
|
|
72
|
+
|
|
73
|
+
def jobs(
|
|
74
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[IndeedJobsInput]
|
|
75
|
+
) -> RunResult[IndeedJobsData]:
|
|
76
|
+
"""Indeed Jobs
|
|
77
|
+
|
|
78
|
+
Search Indeed job listings by keyword, location, and country - up to 20
|
|
79
|
+
normalized job records per request at a flat USD price.
|
|
80
|
+
|
|
81
|
+
Price: $0.0008 per request plus $0.00008 per result.
|
|
82
|
+
|
|
83
|
+
Example:
|
|
84
|
+
res = client.indeed.jobs(limit=3, location="Austin, TX", query="data analyst")
|
|
85
|
+
"""
|
|
86
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
87
|
+
"indeed.jobs", dict(input), options
|
|
88
|
+
)
|
|
89
|
+
return RunResult[IndeedJobsData].model_validate(raw)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class AsyncIndeedNamespace:
|
|
93
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
94
|
+
|
|
95
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
96
|
+
self._client = client
|
|
97
|
+
|
|
98
|
+
async def jobs(
|
|
99
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[IndeedJobsInput]
|
|
100
|
+
) -> RunResult[IndeedJobsData]:
|
|
101
|
+
"""Indeed Jobs
|
|
102
|
+
|
|
103
|
+
Search Indeed job listings by keyword, location, and country - up to 20
|
|
104
|
+
normalized job records per request at a flat USD price.
|
|
105
|
+
|
|
106
|
+
Price: $0.0008 per request plus $0.00008 per result.
|
|
107
|
+
|
|
108
|
+
Example:
|
|
109
|
+
res = client.indeed.jobs(limit=3, location="Austin, TX", query="data analyst")
|
|
110
|
+
"""
|
|
111
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
112
|
+
"indeed.jobs", dict(input), options
|
|
113
|
+
)
|
|
114
|
+
return RunResult[IndeedJobsData].model_validate(raw)
|