DataForSeo provides comprehensive SEO and digital marketing data solutions via API. TheThis notebook demonstrates how to use the DataForSeo API to obtain search engine results.DataForSeo API
retrievesSERP
from the most popular search engines likeBing
,Yahoo
. It also allows to >get SERPs from different search engine types likeMaps
,News
,Events
, etc.
DataForSeo
website.
run
and results
run
and results
are two methods provided by the DataForSeoAPIWrapper
class.
The run
method executes the search and returns the first result snippet from the answer box, knowledge graph, featured snippet, shopping, or organic results. These elements are sorted by priority from highest to lowest.
The results
method returns a JSON response configured according to the parameters set in the wrapper. This allows for more flexibility in terms of what data you want to return from the API.
Tool
class from the langchain.agents
module to integrate the DataForSeoAPIWrapper
with a langchain agent. The Tool
class encapsulates a function that the agent can call.