An integration package connecting CrustAPI (Google search data) and LangChain
Project description
langchain-crustapi
This package connects CrustAPI to LangChain, giving your chains and agents clean, structured Google data from one endpoint: web search, Maps, News, Shopping, Images, Videos, Places, Scholar, and Patents. You only pay for successful results, and there's a free tier with no card.
Installation
pip install -U langchain-crustapi
export CRUSTAPI_API_KEY="your-key" # free at https://crustapi.com
Usage
from langchain_crustapi import CrustAPISearch
# Web search (default)
tool = CrustAPISearch(max_results=5)
tool.invoke({"query": "best crm software"})
# Pick a Google surface
maps = CrustAPISearch(search_type="maps", location="Austin, TX")
maps.invoke({"query": "dentists"})
news = CrustAPISearch(search_type="news")
news.invoke({"query": "openai"})
Bind it to an agent like any other LangChain tool:
from langchain.chat_models import init_chat_model
from langchain_crustapi import CrustAPISearch
llm = init_chat_model("gpt-4o-mini")
agent_llm = llm.bind_tools([CrustAPISearch()])
Parameters
search_type: the Google surface —web(default),news,maps,places,shopping,images,videos,scholar,patents.max_results: number of results to return (default10).gl: two-letter country code, e.g.us.hl: two-letter language code, e.g.en.location: city or region for local results, e.g.Austin, TX.
The API key is read from the CRUSTAPI_API_KEY environment variable, or you can pass crustapi_api_key when constructing the tool.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_crustapi-0.1.0.tar.gz.
File metadata
- Download URL: langchain_crustapi-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64424a9946564070eb0c069aa7772cb9c881c21a5c5ba6680622da1c78bed28b
|
|
| MD5 |
280d3766d44eded4583b7b927708d008
|
|
| BLAKE2b-256 |
2da78e9e5a6b7d4356f73e366337f19de3080a19f4a7147296b25adde2bf21c7
|
Provenance
The following attestation bundles were made for langchain_crustapi-0.1.0.tar.gz:
Publisher:
publish.yml on CrustAPI/langchain-crustapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_crustapi-0.1.0.tar.gz -
Subject digest:
64424a9946564070eb0c069aa7772cb9c881c21a5c5ba6680622da1c78bed28b - Sigstore transparency entry: 2165236005
- Sigstore integration time:
-
Permalink:
CrustAPI/langchain-crustapi@51e7413f11e6f798e6c1b701cfef86015c151f03 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CrustAPI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@51e7413f11e6f798e6c1b701cfef86015c151f03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file langchain_crustapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_crustapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
259c431d53b487e22d2448776207b5dfbfd4cd48e8c9d6b81bf522cb21368df9
|
|
| MD5 |
c73af9bb99d17c3687c3514dcc8ccd97
|
|
| BLAKE2b-256 |
a5d2f61925e1ba64d020c2c284618088db810a106a94d2437e1937bb57ba0c8e
|
Provenance
The following attestation bundles were made for langchain_crustapi-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CrustAPI/langchain-crustapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_crustapi-0.1.0-py3-none-any.whl -
Subject digest:
259c431d53b487e22d2448776207b5dfbfd4cd48e8c9d6b81bf522cb21368df9 - Sigstore transparency entry: 2165236016
- Sigstore integration time:
-
Permalink:
CrustAPI/langchain-crustapi@51e7413f11e6f798e6c1b701cfef86015c151f03 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CrustAPI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@51e7413f11e6f798e6c1b701cfef86015c151f03 -
Trigger Event:
push
-
Statement type: