Skip to main content
This quickstart uses plain JSON over HTTP with curl.

Before you begin

You need three things before your first request:

Run your first query

1

Set your credentials

Put the API key in Authorization as-is, with no Bearer prefix. Put your tenant domain in X-Tenant-ID.
2

List the five most recent reports

3

Read the response

You get an array of reports and a pagination cursor:
A report that is only suspected omits verifiedAt:
The API omits empty and default fields. A suspicious report has no verifiedAt. A non-withdrawn report has no withdrawn field, so treat a missing withdrawn as false. A report with no indicators has no iocs.
4

Get the next page

Pass the nextPageToken back as pageToken:
Repeat until nextPageToken comes back empty.

Read the indicators

Each entry in iocs is one indicator of compromise (IOC). Reports and campaigns use the same shape: Use disposition to decide what to block:
Block only indicators with INDICATOR_DISPOSITION_ACTIVE. Use the other dispositions as context for an investigation. If you block every indicator, you block GitHub and Telegram for your users.
This command prints the indicators to block from one page of reports:
SafeDep can change a disposition. The report then returns in the feed with the new value, so your mirror picks up the change. If SafeDep withdraws an indicator, the indicator disappears from all reports and campaigns.

Next steps

Pagination & sync

Turn this loop into a local mirror that stays current.

Package reports

Filter by ecosystem, verdict, and time, and fetch a single report.

Recipes

Mirror the feed, poll for new malicious packages, and expand a campaign.

Connecting

See transport, headers, and JSON conventions in full.