|
1 | | -# langchain-scraperapi |
| 1 | +# Langchain ScraperAPI Integration |
2 | 2 |
|
3 | | -This package contains the LangChain integration with ScraperAPI |
| 3 | +This package contains the LangChain integration with ScraperAPI. |
4 | 4 |
|
5 | 5 | ## Installation |
6 | 6 |
|
7 | 7 | ```bash |
8 | 8 | pip install -U langchain-scraperapi |
9 | 9 | ``` |
10 | 10 |
|
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`. |
12 | 12 |
|
13 | | -* TODO: fill this out |
| 13 | +## Tools |
14 | 14 |
|
15 | | -## Chat Models |
| 15 | +### ScraperAPITool |
16 | 16 |
|
17 | | -`ChatScraperAPI` class exposes chat models from ScraperAPI. |
| 17 | +`ScraperAPITool` exposes the web scraping tool from ScraperAPI. |
18 | 18 |
|
19 | 19 | ```python |
20 | | -from langchain_scraperapi import ChatScraperAPI |
| 20 | +from langchain_scraperapi import ScraperAPITool |
21 | 21 |
|
22 | | -llm = ChatScraperAPI() |
23 | | -llm.invoke("Sing a ballad of LangChain.") |
| 22 | +tool = ScraperAPITool() |
| 23 | +tool.invoke("url: http://example.com", "output_format": "markdown") |
24 | 24 | ``` |
25 | 25 |
|
26 | | -## Embeddings |
| 26 | +### ScraperAPIGoogleSearchTool |
27 | 27 |
|
28 | | -`ScraperAPIEmbeddings` class exposes embeddings from ScraperAPI. |
| 28 | +`ScraperAPIGoogleSearchTool` allows the scraping of Google search results in `json` or `csv` format. |
29 | 29 |
|
30 | 30 | ```python |
31 | | -from langchain_scraperapi import ScraperAPIEmbeddings |
| 31 | +from langchain_scraperapi import ScraperAPIGoogleSearchTool |
32 | 32 |
|
33 | | -embeddings = ScraperAPIEmbeddings() |
34 | | -embeddings.embed_query("What is the meaning of life?") |
| 33 | +tool = ScraperAPIGoogleSearchTool() |
| 34 | +tool.invoke("query": "What is ScraperAPI?") |
35 | 35 | ``` |
36 | 36 |
|
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. |
39 | 40 |
|
40 | 41 | ```python |
41 | | -from langchain_scraperapi import ScraperAPILLM |
| 42 | +from langchain_scraperapi import ScraperAPIAmazonSearchTool |
42 | 43 |
|
43 | | -llm = ScraperAPILLM() |
44 | | -llm.invoke("The meaning of life is") |
| 44 | +tool = ScraperAPIAmazonSearchTool() |
| 45 | +tool.invoke("query": "office chairs", "output_format": "csv") |
45 | 46 | ``` |
| 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 |
0 commit comments