Overview
plugins
¶
Scrape.do Async-API Plugin Adapters
This sub-package defines pydantic models for the optional Plugin key that
can be sent in the Async Job Creation JSON payload in
order to create asynchronous tasks that use the Scrape.do's Plugins endpoints
What Do These Models Represent
-
Each one of the
*AsyncPluginmodels defined here represents a singleAsync API Jobusing thePluginskey -
When creating an
Async API Jobthat uses aScrape.do Plugin, all of its tasks must be requests to the specifiedScrape.do Pluginthat will be executed asynchronously. Therefore, noTargetscan be specified for a plugin job, which is whyTargetsandPluginare mutually exclusive keys when creating anAsync API Job
Constraints
-
Each
*AsyncPluginmodel enforcesmin_length=1, max_length=1000on itsparamslist -
The cap matches
Scrape.do'sdocumented per-job maximum of1000tasks forplugin-jobs -
Each
*AsyncPluginmodel haspopulate_by_name=Trueandextra="ignore"so additions on the server side don't break parsing
key + params Attributes
-
Every
*AsyncPluginmodel contains thekeyandparamsattributes -
The
keyattribute is a literal string representing the name of theScrape.do Pluginthat theAsync API Jobwill use. (Only one plugin can be used perAsync API Job) -
The
paramsattribute is a list ofPlugin-Specific Parametersthat define a single task in thatAsync API Job(i.e, Onerequestto theScrape.do Pluginspecified by thekey)
Difference From Sync Plugins
While the Plugin-Specific Parameters accepted by the params
attribute of the *AsyncPlugin models are the same pydantic
*Parameters models used by the Sync Plugins,
the following distinctions regarding the synchronous vs asynchronous
usage of Scrape.do Plugins must be considered
-
Only a subset of the synchronous
Scrape.do Pluginscan be used asynchronously through theScrape.do Async API -
Some parameters that are accepted by the synchronous version of a plugin might be silently dropped or restricted by the server while using the
Async APIversion of that plugin -
Each
*AsyncPluginmodel known to have this behaviour will contain a warning with more information about what to keep in mind while using it
Async-Only Plugins
The walmart/store,
lowes/store,
shein,
trip/search,
and trip/detail
plugins are only available through the Async API and do not have
dedicated synchronous endpoints, which is why they don't exist in the
Sync Plugins Sub-Package
Official Documentation
The structure of these models and all information contained here comes
from manual testing and the official Scrape.do Async API Plugins,
Scrape.do Amazon Plugin, Scrape.do Google Plugin, and Scrape.do ChatGPT Plugin documentation pages
AsyncPlugin
module-attribute
¶
AsyncPlugin = Annotated[
Union[
AmazonPdpAsyncPlugin,
AmazonSearchAsyncPlugin,
AmazonOfferListingAsyncPlugin,
ChatGPTChatAsyncPlugin,
GoogleSearchAsyncPlugin,
GoogleSearchAiModeAsyncPlugin,
GoogleSearchAiOverviewAsyncPlugin,
GoogleMapsSearchAsyncPlugin,
GoogleMapsPlaceAsyncPlugin,
GoogleMapsReviewsAsyncPlugin,
GoogleShoppingAsyncPlugin,
GoogleShoppingProductAsyncPlugin,
GoogleShoppingProductStoresAsyncPlugin,
GoogleFlightsAsyncPlugin,
GoogleHotelsAsyncPlugin,
GoogleHotelsDetailAsyncPlugin,
GoogleNewsAsyncPlugin,
GoogleTrendsAsyncPlugin,
GoogleTrendingAsyncPlugin,
GoogleYouTubeAsyncPlugin,
GooglePlayStoreAsyncPlugin,
GooglePlayStoreProductAsyncPlugin,
GooglePlayStoreReviewsAsyncPlugin,
WalmartStoreAsyncPlugin,
LowesStoreAsyncPlugin,
SheinAsyncPlugin,
TripSearchAsyncPlugin,
TripDetailAsyncPlugin,
],
Field(discriminator="key"),
]
Discriminated union of every supported Async API Plugin adapter
Additional Information
-
Tagged by the literal
keyfield on each*AsyncPluginmodel -
Consumed by
JobCreationRequest.plugin
New Plugins
-
If a new plugin lands server-side, its domain
*Parametersmodel will be added in theSync Plugins Sub-Package -
After that, a new
*AsyncPluginadapter will be added to a new module in this sub-package and appended to theUnion[...]above so thatpydanticcan pick up the new discriminator value