Create URL Scan
Submit a URL to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYAPI Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Accepted Permissions (at least one required)
URL Scanner WriteURL Scanner ReadParametersExpand Collapse
params ScanNewParams
ScreenshotsResolutions param.Field[[]ScanNewParamsScreenshotsResolution]optionalBody param: Take multiple screenshots targeting different device types.
Body param: Take multiple screenshots targeting different device types.
Body param: The option Public means it will be included in listings like recent scans and search results. Unlisted means it will not be included in the aforementioned listings, users will need to have the scan's ID to access it. A a scan will be automatically marked as unlisted if it fails, if it contains potential PII or other sensitive material.
Body param: The option Public means it will be included in listings like recent scans and search results. Unlisted means it will not be included in the aforementioned listings, users will need to have the scan's ID to access it. A a scan will be automatically marked as unlisted if it fails, if it contains potential PII or other sensitive material.
Create URL Scan
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/url_scanner"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
scan, err := client.URLScanner.Scans.New(context.TODO(), url_scanner.ScanNewParams{
AccountID: cloudflare.F("account_id"),
URL: cloudflare.F("https://www.example.com"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", scan.UUID)
}
{
"api": "api",
"message": "Submission successful",
"result": "result",
"url": "url",
"uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"visibility": "public",
"options": {
"useragent": "useragent"
}
}Returns Examples
{
"api": "api",
"message": "Submission successful",
"result": "result",
"url": "url",
"uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"visibility": "public",
"options": {
"useragent": "useragent"
}
}