urlscan

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

README

urlscan

A urlscan.io API library for Go

urlscan logo

Features

  • Scanning URLs with urlscan
  • Getting scan results
  • Searching for scan results

Usage

Initializing the Client

To get an API Key, sign up for urlscan and go to the "Settings & API" profile menu

    client := urlscan.NewClient("MY-API-KEY")
Scanning
scan, err := client.Scan("https://example.com", urlscan.ScanOptions{
		Tags:    []string{"test", "urlscan-go"},
		Country: "ca",
	})
Getting a result
result, err := client.GetResult("result-uuid-here")
Searching
result, _ := client.Search("domain:(example.com OR example.net)", 100)

for _, result := range result.Results {
	// Do something here
}

For further documentation, see this package at pkg.go.dev

Documentation

Index

Constants

View Source
const BaseUrl = "https://urlscan.io/api/v1"
View Source
const Version = "0.1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey string) Client

func (Client) GetResult

func (c Client) GetResult(uuid string) (*structs.ResultData, error)

Get the urlscan result for the specified scan UUID

func (Client) Scan

func (c Client) Scan(url string, options ScanOptions) (*structs.ScanResponse, error)

Scan the Specified URL with the set options

func (Client) Search

func (c Client) Search(query string, size int) (*structs.SearchResult, error)

type RequestData

type RequestData struct {
	// contains filtered or unexported fields
}

type ScanOptions

type ScanOptions struct {
	// The visibility level of the scan. Either "public", "unlisted", or "private"
	Visibility string
	// User-defined tags used to annotate the scan (e.g. "phishing", "malicious"). Maximum 10 tags.
	Tags []string
	// Override User-Agent for this scan
	CustomAgent string
	// Override HTTP referer header for this scan
	CustomReferer string
	// The country to scan the URL from, see [the API] for a list of possible values
	//
	// [the API]: https://urlscan.io/api/v1/availableCountries
	Country string
}

Optional values for the Scan API

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL