SCP46: Raw Zyte API params

What it does

When using scrapy-zyte-api, reports the use of zyte_api in meta or the ZYTE_API_DEFAULT_PARAMS setting.

Why is this bad?

zyte_api is used to send raw parameters to Zyte API. Unlike zyte_api_automap, it does not automatically map Request parameters (besides url) to Zyte API parameters.

Similarly, ZYTE_API_DEFAULT_PARAMS is used to set default parameters for requests that use raw Zyte API parameters. When using ZYTE_API_TRANSPARENT_MODE (default) or zyte_api_automap, you must use ZYTE_API_AUTOMAP_PARAMS instead of ZYTE_API_DEFAULT_PARAMS.

Example

If using ZYTE_API_TRANSPARENT_MODE and params that can be automatically mapped, instead of:

Request(url, meta={"zyte_api": {"httpResponseBody": True}})

Remove the meta key altogether and let automatic mapping do its job:

Request(url)

If you need to set Zyte API param with no equivalent in Request, instead of:

Request(url, meta={"zyte_api": {"httpResponseBody": True, "geolocation": "ie"}})

Use zyte_api_automap:

Request(url, meta={"zyte_api_automap": {"geolocation": "ie"}})

If you are using zyte_api because you have set ZYTE_API_AUTOMAP_PARAMS but you want different parameters for a specific request, set zyte_api_default_params to False instead:

Request(url, meta={"zyte_api_default_params": False})