DataForSEO
DataForSeo provides comprehensive SEO and digital marketing data solutions via API.
The
DataForSeo APIretrievesSERPfrom the most popular search engines likeBing,Yahoo. It also allows to >get SERPs from different search engine types likeMaps,News,Events, etc.
This notebook demonstrates how to use the DataForSeo API to obtain search engine results.
%pip install --upgrade --quiet langchain-community
from langchain_community.utilities.dataforseo_api_search import DataForSeoAPIWrapper
API Reference:DataForSeoAPIWrapper
Setting up the API credentials
You can obtain your API credentials by registering on the DataForSeo website.
import os
os.environ["DATAFORSEO_LOGIN"] = "your_api_access_username"
os.environ["DATAFORSEO_PASSWORD"] = "your_api_access_password"
wrapper = DataForSeoAPIWrapper()
The run method will return the first result snippet from one of the following elements: answer_box, knowledge_graph, featured_snippet, shopping, organic.
wrapper.run("Weather in Los Angeles")