Skip to content

Commit 1e4e8e5

Browse files
authored
Merge pull request #1 from scraperapi/dev
Adds scraperapi integration
2 parents 773451c + 468056d commit 1e4e8e5

34 files changed

+2765
-3702
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
.env
2+
.vscode
13
__pycache__
4+
.pytest_cache

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
1-
# langchain-scraperapi
1+
# Langchain ScraperAPI Integration
22

3-
This package contains the LangChain integration with ScraperAPI
3+
This package contains the LangChain integration with ScraperAPI.
44

55
## Installation
66

77
```bash
88
pip install -U langchain-scraperapi
99
```
1010

11-
And you should configure credentials by setting the following environment variables:
11+
And you should configure credentials by setting the environment variable `SCRAPERAPI_API_KEY`.
1212

13-
* TODO: fill this out
13+
## Tools
1414

15-
## Chat Models
15+
### ScraperAPITool
1616

17-
`ChatScraperAPI` class exposes chat models from ScraperAPI.
17+
`ScraperAPITool` exposes the web scraping tool from ScraperAPI.
1818

1919
```python
20-
from langchain_scraperapi import ChatScraperAPI
20+
from langchain_scraperapi import ScraperAPITool
2121

22-
llm = ChatScraperAPI()
23-
llm.invoke("Sing a ballad of LangChain.")
22+
tool = ScraperAPITool()
23+
tool.invoke("url: http://example.com", "output_format": "markdown")
2424
```
2525

26-
## Embeddings
26+
### ScraperAPIGoogleSearchTool
2727

28-
`ScraperAPIEmbeddings` class exposes embeddings from ScraperAPI.
28+
`ScraperAPIGoogleSearchTool` allows the scraping of Google search results in `json` or `csv` format.
2929

3030
```python
31-
from langchain_scraperapi import ScraperAPIEmbeddings
31+
from langchain_scraperapi import ScraperAPIGoogleSearchTool
3232

33-
embeddings = ScraperAPIEmbeddings()
34-
embeddings.embed_query("What is the meaning of life?")
33+
tool = ScraperAPIGoogleSearchTool()
34+
tool.invoke("query": "What is ScraperAPI?")
3535
```
3636

37-
## LLMs
38-
`ScraperAPILLM` class exposes LLMs from ScraperAPI.
37+
### ScraperAPIAmazonSearchTool
38+
39+
`ScraperAPIAmazonSearchTool` allows the scraping of Amazon search results in `json` or `csv` format.
3940

4041
```python
41-
from langchain_scraperapi import ScraperAPILLM
42+
from langchain_scraperapi import ScraperAPIAmazonSearchTool
4243

43-
llm = ScraperAPILLM()
44-
llm.invoke("The meaning of life is")
44+
tool = ScraperAPIAmazonSearchTool()
45+
tool.invoke("query": "office chairs", "output_format": "csv")
4546
```
47+
48+
For a full list of parameters and more information, refer to the ScraperAPI Python docs: https://docs.scraperapi.com/python/making-requests/structured-data-collection-method

docs/chat.ipynb

Lines changed: 0 additions & 262 deletions
This file was deleted.

0 commit comments

Comments
 (0)