Skip to main content

langchain-findcheap

Findcheap for LangChain agents: where a product is sold for less. Five tools over the Findcheap API, each a thin wrapper around the findcheap client. Python 3.10+.

pip install langchain-findcheap
export FINDCHEAP_API_KEY=fc_live_...   # from https://findcheap.ai/signin?next=/dashboard/keys

An account is free: 1,000 credits a month, no card.

Use with an agent

from langchain.agents import create_agent
from langchain_findcheap import FindcheapToolkit

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

result = agent.invoke({"messages": [{"role": "user", "content":
    "Find where this is available for a lower price: https://findcheap.ai/sample-product"}]})
print(result["messages"][-1].content)

Any chat model that calls tools works. This example also needs pip install langchain langchain-anthropic and an ANTHROPIC_API_KEY.

The tools

Tool Class What it does Credits
find_cheaper FindcheapFindCheaper Finds where the product on a page is sold for less: the same product and acceptable equivalents, cheapest first. Up to 60 seconds. 10
search_products FindcheapSearchProducts Finds listings that match a description in words, or a photo's link, cheapest first. 10
read_product_page FindcheapReadProductPage Reads what a page sells (title, price, brand, stock), without a search. 1
resolve_listing FindcheapResolveListing Gives the merchant's link for a card that came with a resolve_id. 1 when a link came back
submit_feedback FindcheapSubmitFeedback Reports how a search went. The first report on a search gives 1 credit back. 0

They carry the names and the descriptions of the tools of Findcheap's MCP server, so an answer's next_steps name these tools and their fields.

find_cheaper, read_product_page and search_products require objective: what the shopper wants, in one sentence. An agent writes it on every call.

submit_feedback is the one tool that writes: it sends Findcheap a report on a search. To leave it out, build the list yourself:

from langchain_findcheap import FindcheapFindCheaper, FindcheapReadProductPage

tools = [FindcheapFindCheaper(), FindcheapReadProductPage()]

Call a tool yourself

from langchain_findcheap import FindcheapFindCheaper

answer = FindcheapFindCheaper().invoke({"url": "https://findcheap.ai/sample-product", "max_results": 3,
                                        "objective": "These shoes for less, new."})
print(answer["product"]["title"], answer["page_is_cheapest"])
for card in answer["same_product"]:
    print(card["price"], card["currency"], card["retailer"], card["url"] or card["resolve_id"])

A tool answers what the API answers, untouched: every field is in the reference, https://findcheap.ai/developers/docs.md. A call the API refuses (a page that is not a product page, credits used up, a rate limit) reaches the model as the tool's answer, in the API's own words, so the agent can act on it; it does not stop the agent.

Each tool and the toolkit take api_key= (in place of the environment variable), timeout= (seconds, for every call) and base_url=.

Tests

pip install -e ".[test]" && python -m pytest

Offline: LangChain's standard tests for tools and this package's own, over a local stub of the API.

Metadata

Release files for langchain-findcheap 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-findcheap 0.1.0
File Size Uploaded Provenance Actions
langchain_findcheap-0.1.0.tar.gz 18.6 kB Without provenance Details for langchain_findcheap-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 31.0 kB

Release files / langchain_findcheap-0.1.0.tar.gz

Download URL langchain_findcheap-0.1.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a0e9c794ec1b912eb43c583bf2b621f80d177bb8412e25313a6a5c56c96475fd
BLAKE2b-256 checksum
How to use checksums
dba65c9640f7c9782d44f1807cb6e0853b42b65e928fdb8bb37faa86fdfeec12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL langchain_findcheap-0.1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
426112cdab35d35f349080551027de16a5c077b9e2ca392646bb32a48e4176b9
BLAKE2b-256 checksum
How to use checksums
ae4bb3898bf7425feeaf63f6ddb42ce0cd69c239e971367f4073594df66cd745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for langchain-findcheap 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