Skip to main content

langchain-crowdwisdom

LangChain tools for CrowdWisdom Trading: the crowd's daily and weekly sentiment for one ticker, as a single score from thousands of pro traders.

  • Free, no API key. 50 calls a day per IP address.
  • Covers US stocks, ETFs, crypto (e.g. BTC-USD), futures (e.g. GC=F) and FX.
  • Returns ProCrowdSentimentScore from -100 (everyone short) to +100 (everyone long), ProTraders (how many distinct pro traders are behind it) and the session date.

The data is aggregated crowd opinion for research only. It is not investment advice.

Installation

pip install -U langchain-crowdwisdom

Tools

Class Tool name Route
CrowdWisdomSentimentToday crowdwisdom_sentiment_today GET /x402/daily/{ticker}
CrowdWisdomSentimentWeek crowdwisdom_sentiment_week GET /x402/weekly/{ticker}
CrowdWisdomToolkit both tools above

Both tools take one argument, ticker.

Usage

Call a tool directly

from langchain_crowdwisdom import CrowdWisdomSentimentToday

tool = CrowdWisdomSentimentToday()
print(tool.invoke({"ticker": "AAPL"}))
{"ticker": "AAPL", "cycle": "daily", "date": "2026-11-23", "ProCrowdSentimentScore": -0.9, "ProTraders": 390,
 "scale": "-100 = everyone short, 0 = split, +100 = everyone long", "source": "CrowdWisdom Trading",
 "learn_more": "https://www.crowdwisdomtrading.com/x402", "disclaimer": "..."}

When called with a ToolCall, the tool returns a ToolMessage whose content is the JSON above and whose artifact is the full API response.

Use the toolkit in an agent

from langchain.agents import create_agent
from langchain_crowdwisdom import CrowdWisdomToolkit

tools = CrowdWisdomToolkit().get_tools()
agent = create_agent("anthropic:claude-sonnet-4-5", tools)

result = agent.invoke(
    {"messages": [{"role": "user", "content": "What is the crowd's weekly sentiment on SPY and on BTC-USD?"}]}
)
print(result["messages"][-1].content)

Any chat model with tool calling works the same way, e.g. llm.bind_tools(tools).

Errors

Errors come back to the model as a tool message, not an exception:

Case Message
Unknown ticker (HTTP 404) CrowdWisdom Trading has no crowd sentiment for 'XYZ'...
Free limit reached (HTTP 429 FREE_LIMIT_REACHED) CrowdWisdom Trading free limit reached (50 calls a day per IP)...

The tools never pay and never send a key, even if CWT_API_KEY or X402_WALLET_PRIVATE_KEY is set. Answers are cached on disk for 10 minutes, so repeat calls for the same ticker do not use up the free limit.

The tools are built on the MIT crowdwisdomtrading Python client, which also has paid per-call routes (direction, per-source scores, history).

Development

pip install -e ".[test]"
pytest tests/unit_tests --disable-socket -k "not async"   # offline, mocked HTTP
pytest tests/unit_tests                                    # incl. async test (needs a local socket on Windows)
pytest tests/integration_tests                             # live, at most 2 calls to the free API

License

MIT

Metadata

Release files for langchain-crowdwisdom 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-crowdwisdom 0.1.0
File Size Uploaded Provenance Actions
langchain_crowdwisdom-0.1.0.tar.gz 6.5 kB Without provenance Details for langchain_crowdwisdom-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-crowdwisdom 0.1.0
File Interpreter ABI Platform Actions
langchain_crowdwisdom-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_crowdwisdom-0.1.0-py3-none-any.whl

Total release size: 14.1 kB

Release files / langchain_crowdwisdom-0.1.0.tar.gz

Download URL langchain_crowdwisdom-0.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
21cb32b0a6a480e75560c0e83cad3396a3bd84658282f4851e123fc500416f89
BLAKE2b-256 checksum
How to use checksums
e9e21dcce9b73c5e1f7aefbbff0dd1df46640049882e3ec31d7899bdc889cd6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.8

Release files / langchain_crowdwisdom-0.1.0-py3-none-any.whl

Download URL langchain_crowdwisdom-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fddb0258ac957668a10b3e96c622f7d87dec39b28c71ba14c6877fb56fdc39e6
BLAKE2b-256 checksum
How to use checksums
188dd439990f5bcf72fdabc8d7abf0b764b4f14b3af59a3f0c979c8452a00d33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.8

Security for langchain-crowdwisdom 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page