langchain-dataxapi 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.
@@ -0,0 +1,258 @@
1
+ """DataXAPI tools for LangChain.
2
+
3
+ ``DataXAPIFind`` searches the catalog of DataXAPI endpoints for free; ``DataXAPICall`` calls any of
4
+ them by ID. The tools in ``endpoint_tools`` each call one endpoint with its own typed arguments.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import json
10
+ from collections.abc import Callable
11
+ from typing import Any, ClassVar
12
+
13
+ from langchain_core.callbacks import AsyncCallbackManagerForToolRun, CallbackManagerForToolRun
14
+ from langchain_core.tools import BaseTool, ToolException
15
+ from langchain_core.utils import secret_from_env
16
+ from pydantic import BaseModel, Field, SecretStr, field_validator
17
+
18
+ from langchain_dataxapi._client import (
19
+ DEFAULT_BASE_URL,
20
+ DEFAULT_TIMEOUT,
21
+ DataXAPIClient,
22
+ DataXAPIError,
23
+ summarize,
24
+ )
25
+
26
+ _DOCS = "https://dataxapi.com"
27
+
28
+
29
+ def _dump(value: Any) -> str:
30
+ return json.dumps(value, ensure_ascii=False)
31
+
32
+
33
+ class DataXAPIBaseTool(BaseTool):
34
+ """Base of the DataXAPI tools: the API key, the HTTP client and the shape of an answer.
35
+
36
+ Setup:
37
+ .. code-block:: bash
38
+
39
+ pip install -U langchain-dataxapi
40
+ export DATAXAPI_API_KEY="dx_..."
41
+
42
+ A tool answers with a JSON string: ``data`` (an ``items`` list or one ``item``), ``page``
43
+ (``next_cursor`` for the next page), ``billing`` (``amount`` charged in US dollars and
44
+ ``balance_after``) and ``request_id``. An error comes back as the tool's answer, naming the error
45
+ code, whether anything was charged and whether to retry, so an agent can correct itself; set
46
+ ``handle_tool_error=False`` to raise ``ToolException`` instead.
47
+ """
48
+
49
+ api_key: SecretStr | None = Field(default_factory=secret_from_env("DATAXAPI_API_KEY", default=None))
50
+ """DataXAPI API key. Read from ``DATAXAPI_API_KEY`` when left out."""
51
+ base_url: str = DEFAULT_BASE_URL
52
+ """API base URL."""
53
+ timeout: float = DEFAULT_TIMEOUT
54
+ """Seconds to wait for one answer."""
55
+ transport: Any = Field(default=None, exclude=True, repr=False)
56
+ """An ``httpx`` transport to send requests through instead of the network (tests, proxies)."""
57
+ handle_tool_error: bool | str | Callable[[ToolException], str] | None = True
58
+
59
+ def _client(self) -> DataXAPIClient:
60
+ return DataXAPIClient(
61
+ self.api_key.get_secret_value() if self.api_key else None,
62
+ base_url=self.base_url,
63
+ timeout=self.timeout,
64
+ transport=self.transport,
65
+ )
66
+
67
+
68
+ class DataXAPIEndpointTool(DataXAPIBaseTool):
69
+ """One DataXAPI endpoint with typed arguments. The generated tools set the class variables."""
70
+
71
+ endpoint: ClassVar[str] = ""
72
+ """The endpoint's ID, such as ``douyin.videos.comments.list``."""
73
+ one_of: ClassVar[tuple[str, ...]] = ()
74
+ """Arguments of which at least one must be given, such as ``("id", "url")``."""
75
+ example: ClassVar[dict[str, Any]] = {}
76
+ """Example arguments, from the endpoint's recorded example."""
77
+
78
+ def _params(self, kwargs: dict[str, Any]) -> dict[str, Any]:
79
+ params = {k: v for k, v in kwargs.items() if v is not None and v != "" and v != []}
80
+ if self.one_of and not any(name in params for name in self.one_of):
81
+ raise ToolException(f"Give one of: {', '.join(self.one_of)}. Nothing was sent, so nothing was charged.")
82
+ return params
83
+
84
+ def _run(self, run_manager: CallbackManagerForToolRun | None = None, **kwargs: Any) -> str:
85
+ params = self._params(kwargs)
86
+ try:
87
+ envelope = self._client().call(self.endpoint, params)
88
+ except DataXAPIError as exc:
89
+ raise ToolException(exc.describe()) from exc
90
+ return _dump(summarize(envelope))
91
+
92
+ async def _arun(self, run_manager: AsyncCallbackManagerForToolRun | None = None, **kwargs: Any) -> str:
93
+ params = self._params(kwargs)
94
+ try:
95
+ envelope = await self._client().acall(self.endpoint, params)
96
+ except DataXAPIError as exc:
97
+ raise ToolException(exc.describe()) from exc
98
+ return _dump(summarize(envelope))
99
+
100
+
101
+ class DataXAPIFindInput(BaseModel):
102
+ """Arguments of dataxapi_find."""
103
+
104
+ query: str = Field(
105
+ description="The data needed, in plain words, Chinese or English, for example "
106
+ "'xiaohongshu note comments', '公众号文章阅读数' or 'douyin keyword trend'."
107
+ )
108
+ platform: str | None = Field(
109
+ default=None,
110
+ description="Optional platform ID to narrow the search, such as douyin, xiaohongshu, wechat_mp, "
111
+ "wechat_channels, wechat, weibo, bilibili, zhihu, kuaishou, tiktok, youtube, x, reddit.",
112
+ )
113
+
114
+
115
+ class DataXAPIFind(DataXAPIBaseTool):
116
+ """Find the DataXAPI endpoint for a need described in plain words. Free; needs no API key.
117
+
118
+ Example:
119
+ .. code-block:: python
120
+
121
+ from langchain_dataxapi import DataXAPIFind
122
+
123
+ tool = DataXAPIFind()
124
+ tool.invoke({"query": "xiaohongshu note comments"})
125
+ """
126
+
127
+ name: str = "dataxapi_find"
128
+ description: str = (
129
+ "Free. Searches DataXAPI's catalog of social media and market data endpoints (Douyin, Xiaohongshu, "
130
+ "WeChat Official Accounts, WeChat Channels, WeChat Search, Weibo, Bilibili, Zhihu, Kuaishou, TikTok, "
131
+ "YouTube, X, Reddit and more) by a need described in plain words, Chinese or English. Returns endpoint "
132
+ "IDs with what each returns, its price, required parameters and example parameters. Call the one that "
133
+ "fits with dataxapi_call. Use it when no other DataXAPI tool fits the task."
134
+ )
135
+ args_schema: type[BaseModel] = DataXAPIFindInput
136
+
137
+ @staticmethod
138
+ def _answer(payload: dict[str, Any]) -> str:
139
+ data = payload.get("data") or {}
140
+ matches = []
141
+ for m in data.get("matches") or []:
142
+ if m.get("type") != "capability":
143
+ continue
144
+ pricing = m.get("pricing") or {}
145
+ matches.append(
146
+ {
147
+ "endpoint": m.get("id"),
148
+ "name": (m.get("name") or {}).get("en"),
149
+ "summary": (m.get("summary") or {}).get("en"),
150
+ "required": m.get("required") or [],
151
+ "one_of": m.get("one_of") or [],
152
+ "price_usd": pricing.get("price"),
153
+ "per": pricing.get("per"),
154
+ "example_params": (m.get("example") or {}).get("params"),
155
+ "docs": _DOCS + (m.get("url") or "/apis/"),
156
+ }
157
+ )
158
+ out: dict[str, Any] = {"matches": matches}
159
+ if data.get("unknown"):
160
+ out["not_covered"] = data["unknown"]
161
+ if matches:
162
+ out["next"] = (
163
+ "Call one with dataxapi_call: endpoint = matches[i].endpoint, params = an object like "
164
+ "example_params. Each call is charged at that endpoint's price; errors are not charged."
165
+ )
166
+ else:
167
+ out["next"] = "Nothing matched. Try other words, or browse https://dataxapi.com/apis/."
168
+ return _dump(out)
169
+
170
+ def _run(
171
+ self, query: str, platform: str | None = None, run_manager: CallbackManagerForToolRun | None = None
172
+ ) -> str:
173
+ try:
174
+ return self._answer(self._client().find(query, platform))
175
+ except DataXAPIError as exc:
176
+ raise ToolException(exc.describe()) from exc
177
+
178
+ async def _arun(
179
+ self, query: str, platform: str | None = None, run_manager: AsyncCallbackManagerForToolRun | None = None
180
+ ) -> str:
181
+ try:
182
+ return self._answer(await self._client().afind(query, platform))
183
+ except DataXAPIError as exc:
184
+ raise ToolException(exc.describe()) from exc
185
+
186
+
187
+ class DataXAPICallInput(BaseModel):
188
+ """Arguments of dataxapi_call."""
189
+
190
+ endpoint: str = Field(
191
+ description="The endpoint ID, dot-separated, such as douyin.users.get or xiaohongshu.notes.comments.list. "
192
+ "Find it with dataxapi_find."
193
+ )
194
+ params: dict[str, Any] = Field(
195
+ default_factory=dict,
196
+ description='The endpoint\'s parameters as an object, for example {"query": "coffee", "sort": "latest"}. '
197
+ 'Add "cursor" with the last answer\'s page.next_cursor for the next page.',
198
+ )
199
+
200
+ @field_validator("params", mode="before")
201
+ @classmethod
202
+ def _parse_json(cls, value: Any) -> Any:
203
+ """Accept the parameters as a JSON string too."""
204
+ if isinstance(value, str):
205
+ text = value.strip()
206
+ if not text:
207
+ return {}
208
+ try:
209
+ return json.loads(text)
210
+ except ValueError:
211
+ raise ValueError("params must be a JSON object") from None
212
+ return value
213
+
214
+
215
+ class DataXAPICall(DataXAPIBaseTool):
216
+ """Call any DataXAPI endpoint by its ID, with its parameters as JSON.
217
+
218
+ Example:
219
+ .. code-block:: python
220
+
221
+ from langchain_dataxapi import DataXAPICall
222
+
223
+ tool = DataXAPICall()
224
+ tool.invoke({"endpoint": "douyin.users.get", "params": {"id": "MS4wLjABAAAA..."}})
225
+ """
226
+
227
+ name: str = "dataxapi_call"
228
+ description: str = (
229
+ "Calls any DataXAPI endpoint by its ID (for example douyin.users.get, bilibili.videos.search, "
230
+ "x.posts.search) with its parameters as a JSON object, and returns one page of data. Find the endpoint "
231
+ "ID, its parameters and price with dataxapi_find (free) first. Each call is charged at that endpoint's "
232
+ "price (shown by dataxapi_find); errors are not charged, and every answer says what it cost in "
233
+ "billing.amount (US dollars). For the next page, call again with cursor set to page.next_cursor; each "
234
+ "page is charged on its own. No sign-in to the user's own platform account is needed."
235
+ )
236
+ args_schema: type[BaseModel] = DataXAPICallInput
237
+
238
+ def _run(
239
+ self,
240
+ endpoint: str,
241
+ params: dict[str, Any] | None = None,
242
+ run_manager: CallbackManagerForToolRun | None = None,
243
+ ) -> str:
244
+ try:
245
+ return _dump(summarize(self._client().call(endpoint.strip(), params or {})))
246
+ except DataXAPIError as exc:
247
+ raise ToolException(exc.describe()) from exc
248
+
249
+ async def _arun(
250
+ self,
251
+ endpoint: str,
252
+ params: dict[str, Any] | None = None,
253
+ run_manager: AsyncCallbackManagerForToolRun | None = None,
254
+ ) -> str:
255
+ try:
256
+ return _dump(summarize(await self._client().acall(endpoint.strip(), params or {})))
257
+ except DataXAPIError as exc:
258
+ raise ToolException(exc.describe()) from exc
@@ -0,0 +1,232 @@
1
+ Metadata-Version: 2.5
2
+ Name: langchain-dataxapi
3
+ Version: 0.1.0
4
+ Summary: LangChain tools for DataXAPI: public data from Douyin, Xiaohongshu (RedNote), WeChat, Weibo, Bilibili, Zhihu, Kuaishou, TikTok, YouTube, X and Reddit for agents.
5
+ Project-URL: Homepage, https://dataxapi.com/?ref=langchain
6
+ Project-URL: Documentation, https://github.com/data-x-api/langchain-dataxapi#readme
7
+ Project-URL: Repository, https://github.com/data-x-api/langchain-dataxapi
8
+ Project-URL: Issues, https://github.com/data-x-api/langchain-dataxapi/issues
9
+ Author-email: DataXAPI <support@dataxapi.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: agents,bilibili,douyin,langchain,langgraph,rednote,social media,tiktok,toolkit,tools,wechat,weibo,xiaohongshu,youtube
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development :: Libraries
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: <4.0,>=3.10
18
+ Requires-Dist: httpx<1.0,>=0.27
19
+ Requires-Dist: langchain-core<2.0.0,>=0.3.60
20
+ Description-Content-Type: text/markdown
21
+
22
+ # langchain-dataxapi
23
+
24
+ LangChain tools for [DataXAPI](https://dataxapi.com/?ref=langchain): public data from Douyin, Xiaohongshu (RedNote), WeChat Official Accounts, WeChat Channels, WeChat Search, Weibo, Bilibili, Zhihu and Kuaishou, plus Douyin's trend index, TikTok, YouTube, X and Reddit, for LangChain and LangGraph agents.
25
+
26
+ - **One key, 237 endpoints.** Twelve ready tools for the endpoints DataXAPI's customers call most, plus `dataxapi_find` (free) and `dataxapi_call`, which reach every endpoint.
27
+ - **No sign-in to your own platform account**, no cookies, no QR login.
28
+ - **Pay per call; errors are not charged.** Each tool's description states its price, and every answer says what that call cost (`billing.amount`, US dollars).
29
+ - **Free trial: up to 333 calls, no card.** Top up from $10; the balance does not expire.
30
+
31
+ 中文说明见[下文](#中文说明)。
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install -U langchain-dataxapi
37
+ ```
38
+
39
+ ## Credentials
40
+
41
+ Create a key at <https://dataxapi.com/console/keys/?ref=langchain> (it starts with `dx_`) and set it:
42
+
43
+ ```bash
44
+ export DATAXAPI_API_KEY="dx_..."
45
+ ```
46
+
47
+ Or pass it to a tool or the toolkit: `DataXAPIToolkit(api_key="dx_...")`. `dataxapi_find` needs no key.
48
+
49
+ ## Quick start
50
+
51
+ ```python
52
+ from langchain_dataxapi import DataXAPIXiaohongshuNoteSearch
53
+
54
+ tool = DataXAPIXiaohongshuNoteSearch()
55
+ print(tool.invoke({"query": "露营", "sort": "popular"}))
56
+ ```
57
+
58
+ The answer is a JSON string:
59
+
60
+ ```json
61
+ {
62
+ "endpoint": "xiaohongshu.notes.search",
63
+ "data": {"items": [{"id": "…", "title": "…", "author": {"…": "…"}, "metrics": {"likes": 1024, "…": "…"}}]},
64
+ "page": {"next_cursor": "…", "has_more": true},
65
+ "billing": {"amount": "0.02", "currency": "USD", "balance_after": "9.98"},
66
+ "request_id": "…"
67
+ }
68
+ ```
69
+
70
+ For the next page, call again with `cursor` set to `page.next_cursor`; each page is charged on its own.
71
+
72
+ ## Use in an agent
73
+
74
+ `create_agent` builds a LangGraph agent. Give it the whole toolkit:
75
+
76
+ ```python
77
+ from langchain.agents import create_agent
78
+ from langchain_dataxapi import DataXAPIToolkit
79
+
80
+ tools = DataXAPIToolkit().get_tools()
81
+ agent = create_agent(
82
+ model="claude-sonnet-4-6",
83
+ tools=tools,
84
+ system_prompt="You research Chinese and global social media with the DataXAPI tools. Cite links.",
85
+ )
86
+
87
+ result = agent.invoke(
88
+ {
89
+ "messages": [
90
+ {
91
+ "role": "user",
92
+ "content": "What do people on Xiaohongshu and Douyin say about camping coffee gear this week? "
93
+ "Pick the three most liked posts and summarize their top comments.",
94
+ }
95
+ ]
96
+ }
97
+ )
98
+ print(result["messages"][-1].content)
99
+ ```
100
+
101
+ The agent searches with `dataxapi_xiaohongshu_notes_search` and `dataxapi_douyin_videos_search`, then reads comments with `dataxapi_xiaohongshu_notes_comments_list` and `dataxapi_douyin_videos_comments_list`. For anything without a named tool (a Bilibili user's profile, Weibo hot searches, Zhihu answers), it describes the need to `dataxapi_find`, gets the endpoint ID and parameters, and calls it with `dataxapi_call`.
102
+
103
+ To keep the tool list short, give the agent only the two general tools:
104
+
105
+ ```python
106
+ tools = DataXAPIToolkit(endpoint_tools=False).get_tools() # dataxapi_find and dataxapi_call
107
+ ```
108
+
109
+ A runnable script is in [examples/agent.py](examples/agent.py).
110
+
111
+ ## Tools
112
+
113
+ <!-- tools:start -->
114
+ | Tool | Class | What it returns | Price |
115
+ |---|---|---|---|
116
+ | `dataxapi_find` | `DataXAPIFind` | Endpoints for a need described in plain words, with price and parameters | free |
117
+ | `dataxapi_call` | `DataXAPICall` | Any DataXAPI endpoint by its ID | that endpoint's price |
118
+ | `dataxapi_xiaohongshu_notes_search` | `DataXAPIXiaohongshuNoteSearch` | Search Xiaohongshu notes by terms: title, text, author, engagement counts, images, and a link that opens | $0.02 per call |
119
+ | `dataxapi_douyin_videos_search` | `DataXAPIDouyinVideoSearch` | Search Douyin videos by terms, a page at a time, sorted by relevance, newest or most liked and filtered by time posted: caption, author with follower count, engagement counts | $0.02 per call |
120
+ | `dataxapi_wechat_mp_accounts_articles_list` | `DataXAPIWeChatOfficialAccountArticles` | Get a page of the articles a WeChat Official Account published, newest first: title, digest, link, time published | $0.02 per call |
121
+ | `dataxapi_douyin_videos_comments_list` | `DataXAPIDouyinVideoComments` | Get a page of comments on a Douyin video: text, commenter, likes, reply count, time posted | $0.002 per call |
122
+ | `dataxapi_douyin_videos_metrics` | `DataXAPIDouyinVideoMetrics` | Get a Douyin video's counts as of now, by its ID: plays and likes | $0.002 per call |
123
+ | `dataxapi_wechat_mp_articles_get` | `DataXAPIWeChatArticle` | Get one WeChat Official Account article by its link: title, text, time published, the account's name and IDs | $0.02 per call |
124
+ | `dataxapi_douyin_index_keywords_history` | `DataXAPIDouyinKeywordTrend` | Get the day-by-day search index and composite index of a keyword, or of one to five keywords at once, on Douyin over a date range, from the Douyin index, with the daily averages of the period, of the one before and of a year earlier | $0.006 per call |
125
+ | `dataxapi_wechat_posts_search` | `DataXAPIWeChatSearch` | Get a page of WeChat Search results for search terms: Official Account articles and Channels videos mixed, each saying in type whether it is an article or a video; by relevance, newest or hottest, filtered by time posted, or articles only or videos only: title or description, the source account's name, time published, an article's link (with a band of reads on some), a video's likes and saves | $0.02 per call |
126
+ | `dataxapi_wechat_channels_videos_search` | `DataXAPIWeChatChannelsVideoSearch` | Get a page of WeChat Channels videos for search terms through WeChat Search, by relevance, newest or hottest, filtered by time posted: description, the account's name and avatar, time published, likes and saves, length, cover | $0.02 per call |
127
+ | `dataxapi_xiaohongshu_notes_comments_list` | `DataXAPIXiaohongshuNoteComments` | Get a page of top-level comments on a Xiaohongshu note by ID or link, newest first or hottest first: text, commenter, likes, reply count, time posted | $0.02 per call |
128
+ | `dataxapi_tiktok_videos_search` | `DataXAPITikTokVideoSearch` | Search TikTok videos by keyword, 30 a page; sort by relevance, likes or time posted, and limit how recently they were posted | $0.002 per call |
129
+ | `dataxapi_youtube_videos_transcript_get` | `DataXAPIYouTubeTranscript` | Get the transcript of a YouTube video by ID or link: the whole text and timed segments | $0.002 per call |
130
+ <!-- tools:end -->
131
+
132
+ Live prices are on each endpoint's page at [dataxapi.com/apis](https://dataxapi.com/apis/?ref=langchain).
133
+
134
+ ### Find and call any endpoint
135
+
136
+ ```python
137
+ from langchain_dataxapi import DataXAPICall, DataXAPIFind
138
+
139
+ DataXAPIFind().invoke({"query": "bilibili user profile"})
140
+ # {"matches": [{"endpoint": "bilibili.users.get", "price_usd": "0.002", "example_params": {...}, ...}], ...}
141
+
142
+ DataXAPICall().invoke({"endpoint": "bilibili.users.get", "params": {"id": "8047632"}})
143
+ ```
144
+
145
+ `params` may be an object or a JSON string. Lists such as `keywords` are sent as a JSON body.
146
+
147
+ ### Errors
148
+
149
+ An error comes back as the tool's answer, so an agent can read it and correct itself, for example:
150
+
151
+ ```text
152
+ DataXAPI error invalid_params: A parameter is invalid. Nothing was charged. Fix the request before trying again. Request ID: ….
153
+ ```
154
+
155
+ It names the error code, whether anything was charged and whether to retry. Pass `handle_tool_error=False` to raise `ToolException` instead. Error codes: [dataxapi.com/docs](https://dataxapi.com/docs/?ref=langchain).
156
+
157
+ ### Async
158
+
159
+ Every tool supports `ainvoke`:
160
+
161
+ ```python
162
+ await DataXAPIDouyinVideoSearch().ainvoke({"query": "露营"})
163
+ ```
164
+
165
+ ## Development
166
+
167
+ ```bash
168
+ uv sync --all-groups
169
+ make test # unit tests, HTTP mocked, network off; includes langchain-tests' ToolsUnitTests
170
+ make integration_test # live and free: dataxapi_find only. Paid tests need DATAXAPI_API_KEY and DATAXAPI_RUN_PAID=1
171
+ make generate # rewrite the endpoint tools and the tables from the live catalog
172
+ make lint
173
+ ```
174
+
175
+ The endpoint tools in `langchain_dataxapi/endpoint_tools.py` are written by `scripts/generate_tools.py` from the free catalog at <https://api.dataxapi.com/v1/catalog>: names, argument schemas, allowed values and prices. Do not edit that file by hand.
176
+
177
+ ## 中文说明
178
+
179
+ `langchain-dataxapi` 让 LangChain、LangGraph 智能体直接取抖音、小红书、微信公众号、视频号、微信搜一搜、微博、B 站、知乎、快手、巨量算数,以及 TikTok、YouTube、X、Reddit 的公开数据。
180
+
181
+ - 一个 Key 调全部 237 个接口:12 个常用接口各有现成工具,另有免费的“找接口”(`dataxapi_find`)和“调用任意接口”(`dataxapi_call`)。
182
+ - 不用登录你自己的平台账号,不要 Cookie、不扫码。
183
+ - 按次计费,出错不收费;每个工具的说明写了价格,每次返回都带这次花了多少(`billing.amount`,美元)。
184
+ - 免费试用最多 333 次,不用绑卡;最低充 $10,余额不过期。
185
+
186
+ 安装与设置:
187
+
188
+ ```bash
189
+ pip install -U langchain-dataxapi
190
+ export DATAXAPI_API_KEY="dx_..." # 在 https://dataxapi.com/console/keys/ 创建
191
+ ```
192
+
193
+ ```python
194
+ from langchain.agents import create_agent
195
+ from langchain_dataxapi import DataXAPIToolkit
196
+
197
+ agent = create_agent(model="claude-sonnet-4-6", tools=DataXAPIToolkit().get_tools())
198
+ question = "这周小红书上关于露营咖啡的笔记里,点赞最多的三篇讲了什么?评论区怎么说?"
199
+ agent.invoke({"messages": [{"role": "user", "content": question}]})
200
+ ```
201
+
202
+ <!-- tools-zh:start -->
203
+ | 工具 | 类名 | 拿到什么 | 价格 |
204
+ |---|---|---|---|
205
+ | `dataxapi_find` | `DataXAPIFind` | 用一句话描述要的数据,列出能用的接口、价格和参数 | 免费 |
206
+ | `dataxapi_call` | `DataXAPICall` | 用接口编号加参数调用全部接口里的任何一个 | 按该接口的价格 |
207
+ | `dataxapi_xiaohongshu_notes_search` | `DataXAPIXiaohongshuNoteSearch` | 小红书笔记搜索 | $0.02 一次,出错不收费 |
208
+ | `dataxapi_douyin_videos_search` | `DataXAPIDouyinVideoSearch` | 抖音视频搜索 | $0.02 一次,出错不收费 |
209
+ | `dataxapi_wechat_mp_accounts_articles_list` | `DataXAPIWeChatOfficialAccountArticles` | 微信公众号文章列表 | $0.02 一次,出错不收费 |
210
+ | `dataxapi_douyin_videos_comments_list` | `DataXAPIDouyinVideoComments` | 抖音视频评论 | $0.002 一次,出错不收费 |
211
+ | `dataxapi_douyin_videos_metrics` | `DataXAPIDouyinVideoMetrics` | 抖音视频播放量 | $0.002 一次,出错不收费 |
212
+ | `dataxapi_wechat_mp_articles_get` | `DataXAPIWeChatArticle` | 微信公众号文章详情 | $0.02 一次,出错不收费 |
213
+ | `dataxapi_douyin_index_keywords_history` | `DataXAPIDouyinKeywordTrend` | 抖音巨量算数关键词热度趋势 | $0.006 一次,出错不收费 |
214
+ | `dataxapi_wechat_posts_search` | `DataXAPIWeChatSearch` | 微信搜一搜综合搜索 | $0.02 一次,出错不收费 |
215
+ | `dataxapi_wechat_channels_videos_search` | `DataXAPIWeChatChannelsVideoSearch` | 微信搜一搜视频号视频搜索 | $0.02 一次,出错不收费 |
216
+ | `dataxapi_xiaohongshu_notes_comments_list` | `DataXAPIXiaohongshuNoteComments` | 小红书笔记评论 | $0.02 一次,出错不收费 |
217
+ | `dataxapi_tiktok_videos_search` | `DataXAPITikTokVideoSearch` | TikTok 视频搜索 | $0.002 一次,出错不收费 |
218
+ | `dataxapi_youtube_videos_transcript_get` | `DataXAPIYouTubeTranscript` | YouTube 视频字幕 | $0.002 一次,出错不收费 |
219
+ <!-- tools-zh:end -->
220
+
221
+ 翻页:把上一次返回的 `page.next_cursor` 作为 `cursor` 再调一次,每页单独计费。出错时工具返回一段文字,写明错误码、有没有收费、要不要重试,智能体可以据此自己改正。
222
+
223
+ ## Links
224
+
225
+ - Endpoints and prices: <https://dataxapi.com/apis/?ref=langchain>
226
+ - API docs: <https://dataxapi.com/docs/?ref=langchain>
227
+ - Catalog for AI tools: <https://dataxapi.com/llms-full.txt>
228
+ - Support: support@dataxapi.com
229
+
230
+ ## License
231
+
232
+ MIT
@@ -0,0 +1,10 @@
1
+ langchain_dataxapi/__init__.py,sha256=uY8CE6-zVr_a0Pvq1d5qu6GO8hIN5jSwXgbPXifAhTE,1764
2
+ langchain_dataxapi/_client.py,sha256=4k0n4CB9r-hlKv0tTmiPZ3_tHY1PuKyGsywhQElC7zE,8905
3
+ langchain_dataxapi/endpoint_tools.py,sha256=aa_4g_3jb6oLCSrrFUx6Uqm3xMRR8PlbfQJGN_tLNaM,25588
4
+ langchain_dataxapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ langchain_dataxapi/toolkits.py,sha256=K6BYrzO4T-XGog4xxfhFqS8O5mVNX2fpK7t7u31a-N0,2264
6
+ langchain_dataxapi/tools.py,sha256=fo5NQwoM1DqhJmB6diS2aJL2IXZ7JVCHY32cwXevhrs,10514
7
+ langchain_dataxapi-0.1.0.dist-info/METADATA,sha256=MxsVPVEvHZ7Jj6-nj400j0BqNaLtO2AMZ0KQV6FGxz0,13167
8
+ langchain_dataxapi-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
9
+ langchain_dataxapi-0.1.0.dist-info/licenses/LICENSE,sha256=9YrB5TvvxbDOUuAHfDGQy9Ck8ip6OpyJ65Z02UqxwFs,1069
10
+ langchain_dataxapi-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aurevant LLC
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.