You can bulk export the name, primary domain, score and list of labels of all monitored vendors using the CyberRisk API.

Overview

If you need to export a list of monitored vendors, the CyberRisk API provides an endpoint to do so. The endpoint provides the name of each vendor, its primary domain, any labels associated with the vendor and its current CSR score. This guide shows you how to leverage this endpoint to export your monitored vendors to CSV.

To access the CyberRisk API, you will need to generate and access your API key. For more information on accessing your key, please refer to our guide on Locating your API Key.

Building and Running the Export Script

Here we have provided a few sample scripts that generate a four-column CSV, with headers name, primary_domain, score, labels. If you don’t see your language of choice here, please contact UpGuard Support and we can provide more examples.

For more information on the endpoint we are using here, please visit List monitored vendors.

Ruby

require 'httparty'
require 'json'

$api_key = "1234-567-89..."
$base_url = "https://cyber-risk.upguard.com/api/public"

response = HTTParty.get("#{$base_url}/vendors",
                        :headers => { "Authorization" => $api_key })

header_row = [ "name", "primary_domain", "score", "labels" ]
puts header_row.join(",")

obj = JSON.parse(response.body)
obj["vendors"].each do |vendor|
  columns = [
    vendor["name"],
    vendor["primary_domain"],
    vendor["score"],
    vendor["labels"].join(",")
  ]

  puts columns.join(",")
end

Bash/Curl

#!/bin/bash

API_KEY="1234-567-89..."

curl -H "Authorization: $API_KEY" "https://cyber-risk.upguard.com/api/public/vendors" | jq '.vendors[] | [.name, .primary_domain, .score, .labels] | @csv'

Node: The above command uses the jq command, which you may need to install on your machine.

Tags: cyber risk