An integration package connecting CrustAPI (Google search and public LinkedIn 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) plus public LinkedIn data (profiles, companies, posts, jobs, and people search). 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()])
LinkedIn tool
CrustAPILinkedIn returns public LinkedIn data as the same clean JSON: a person's profile, a company page, recent posts, job listings, or people search. Pick the surface with linkedin_type and pass a LinkedIn URL or keywords.
from langchain_crustapi import CrustAPILinkedIn
# Profile (default)
profile = CrustAPILinkedIn()
profile.invoke({"url": "https://www.linkedin.com/in/satyanadella"})
# People search, with each person's full profile in the same call
people = CrustAPILinkedIn(linkedin_type="search", enrich=True)
people.invoke({"keywords": "growth marketer saas"})
Parameters
CrustAPISearch
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.
CrustAPILinkedIn
linkedin_type:profile(default),company,posts,jobs,search.limit: max results for posts, jobs, or people search.start: result offset for jobs.location: location filter for jobs, e.g.Austin, TX.enrich: people search only, return each person's full profile in the same call.employees: company only, include the employee list.comments: posts only, include comments.
profile, company, and posts take a url. search takes keywords. jobs takes keywords (plus optional location) or a job url.
The API key is read from the CRUSTAPI_API_KEY environment variable, or you can pass crustapi_api_key when constructing either 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.2.0.tar.gz.
File metadata
- Download URL: langchain_crustapi-0.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
565c33ca292542666ef6fa2d5aee3bf2774eada2e2ad8969e34bd2f29ff5c138
|
|
| MD5 |
fcf511a9ef800aa37d3f4bcc7f45b8bc
|
|
| BLAKE2b-256 |
fac66db01b033a2c8da8fdc4ebc11d360285c8fc8af555d226b04d595cdfd599
|
Provenance
The following attestation bundles were made for langchain_crustapi-0.2.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.2.0.tar.gz -
Subject digest:
565c33ca292542666ef6fa2d5aee3bf2774eada2e2ad8969e34bd2f29ff5c138 - Sigstore transparency entry: 2172578962
- Sigstore integration time:
-
Permalink:
CrustAPI/langchain-crustapi@402bc4f25646065becc311b3d1d29597445ee4e1 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/CrustAPI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@402bc4f25646065becc311b3d1d29597445ee4e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file langchain_crustapi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: langchain_crustapi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.0 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 |
8f44d6b9d6770d68b01088c06dac85447a686b5d4f24c2f6ccbfb4ca37fbff45
|
|
| MD5 |
1986609a3a4da3f173d93784b2d2a031
|
|
| BLAKE2b-256 |
a12aea5339bc6d4413261f8591cde1706371e9efd2669f8a90306615d5694a6c
|
Provenance
The following attestation bundles were made for langchain_crustapi-0.2.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.2.0-py3-none-any.whl -
Subject digest:
8f44d6b9d6770d68b01088c06dac85447a686b5d4f24c2f6ccbfb4ca37fbff45 - Sigstore transparency entry: 2172578968
- Sigstore integration time:
-
Permalink:
CrustAPI/langchain-crustapi@402bc4f25646065becc311b3d1d29597445ee4e1 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/CrustAPI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@402bc4f25646065becc311b3d1d29597445ee4e1 -
Trigger Event:
push
-
Statement type: