API Debugger#

API Debugger is a view of the Smart Browser DevTools IDE to build data extraction requests and inspect their result.

See Using the API Debugger to learn how to use the API Debugger.

Open the API Debugger#

To open the API Debugger:

  1. Open the Smart Browser DevTools IDE.

  2. Select Zyte Smart Browser Devtools on the Activity Bar (left-hand side).

  3. Expand the API Debugger view on the side view that opens.

Request view#

The API Debugger is a view with the following elements to build and debug a data extraction request:

  • The input URL field determines the target URL.

  • The Run button sends a request with the configured parameters. See Debug a request.

  • The Show JSON format / Hide JSON format toggle button alternates between the visual options view and the JSON view.

    Both views are kept in sync.

  • In the visual options view, you get the following tabs with options to configure your request parameters:

    • The Data to return tab covers output selection:

      Selecting Browser HTML or Screenshot enables browser rendering. Selecting Raw HTTP response body disables browser rendering. Some options are available or not depending on whether browser rendering is enabled or disabled.

    • The JavaScript tab has a single field, also named JavaScript, which lets you choose JavaScript handling when browser rendering is enabled: enabling JavaScript (yes), disabling JavaScript (no), or letting Zyte API choose the best option based on the target website.

    • The Proxy tab has a single field, Geolocation, which lets you choose the country of origin of your request.

    • The HTTP options tab covers HTTP parameters:

      • HTTP method (only available without browser rendering) determines the request method.

      • Base64-encoded HTTP request body (only available without browser rendering) determines the request body.

        The body must be encoded in base64.

      • Referer header determines the value of the Referer header when browser rendering is enabled. See Set request headers.

      • Custom HTTP request headers (only available without browser rendering) determines the request headers.

        To add a header, enter its name and value, and select Add. To change a header, update its name and value and select Update. To remove a header, select Delete next to it.

    • The Actions tab lets you configure browser actions.

      To add an action, select the type of action in the drop-down box, fill the action parameters, and select Add action. Note that Add action can only be selected when all required fields of the selected type of action have been filled.

      After you add an action, you can select it to expand it and see its parameters. If you edit action parameters, select Update afterwards so that your change takes effect. To delete an action, select Delete.

      See Zyte API browser actions for more information about actions.

  • In the JSON view, you see the JSON code to use as body on a data extraction request.

API Debugger result view#

The result view, which opens when you run a request, contains the following nested tabs:

  • Browser Tools, open by default, shows:

    • Screenshot, only available if the screenshot is enabled in the request.

    • Elements, the browser HTML or HTTP response body depends on which one is enabled in the request.

    • Network, the network activities during the browser rendering, only available for browser rendering mode.

  • Request Details offers the following nested tabs:

    • Logs shows timestamped log messages, only available for browser rendering mode.

    • Actions shows the run time, status and error details of your actions, only available for browser rendering mode.

    • Stats shows some stats about the processing of the request.

    • Raw Response shows the response that you get from Zyte API.