How do I export MetaDefender Cloud scan history as CSV?

This article applies to all active MetaDefender Cloud license holders - whether your product is paid for or issued for evaluation purposes. For more information on our range of licensing and evaluation options, please Read This.

While it is possible to export individual scan results as PDF file on MetaDefender Cloud web interface, the option to export scan history as JSON or CSV isn’t available on the web interface.

However, you can call the API endpoint GET /apikey/scan-history to retrieve scan history as a JSON file and utilize a script to convert the JSON response to a CSV file.

  • If you want to scan history in JSON format, simply save the response to a file.

Below is an example Python script to call this API endpoint and convert the response to a CSV file:

  • In this example, the header “apikey” and the parameters “limit”, “offset” are hardcoded, but you should use environment variables to set these values.
  • The “api_url” has the parameters “limit” and “offset”, which determine how many entries you want to return, and how many entries to skip (sorted chronologically). In this example, “limit=10” and “offset=0” will return the latest 10 entries in scan history.

Python script: scan-history-csv.py

Python
Copy

Running the script will produce the following output, and “scan_history.csv” file in the same directory:

Powershell
Copy

Example CSV file output:

This is only a basic example of how such a script will function, so feel free to customize it to suit your needs.

For queries and concerns on How to export MD Cloud scan history as CSV, please open a Support Case with the OPSWAT team via phone, online chat or form, or feel free to ask the community on our OPSWAT Expert Forum.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard