# URL Scanner ## Domain Types ### URL Scanner Domain - `type URLScannerDomain struct{…}` - `ID int64` - `Name string` - `SuperCategoryID int64` ### URL Scanner Task - `type URLScannerTask struct{…}` - `EffectiveURL string` - `Errors []URLScannerTaskError` - `Message string` - `Location string` - `Region string` - `Status string` - `Success bool` - `Time string` - `URL string` - `UUID string` - `Visibility string` # Responses ## Get raw response `client.URLScanner.Responses.Get(ctx, responseID, query) (*string, error)` **get** `/accounts/{account_id}/urlscanner/v2/responses/{response_id}` Returns the raw response of the network request. Find the `response_id` in the `data.requests.response.hash`. ### Parameters - `responseID string` Response hash. - `query ResponseGetParams` - `AccountID param.Field[string]` Account ID. ### Returns - `type ResponseGetResponse string` Web resource or image. ### Example ```go 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"), ) response, err := client.URLScanner.Responses.Get( context.TODO(), "response_id", url_scanner.ResponseGetParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` # Scans ## Search URL scans `client.URLScanner.Scans.List(ctx, params) (*ScanListResponse, error)` **get** `/accounts/{account_id}/urlscanner/v2/search` Use a subset of ElasticSearch Query syntax to filter scans. Some example queries:

- 'path:"/bundles/jquery.js"': Searches for scans who requested resources with the given path.
- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 where a resource with the given hash was downloaded.
- 'page.domain:microsoft* AND verdicts.malicious:true AND NOT page.domain:microsoft.com': malicious scans whose hostname starts with "microsoft".
- 'apikey:me AND date:[2025-01 TO 2025-02]': my scans from 2025 January to 2025 February. ### Parameters - `params ScanListParams` - `AccountID param.Field[string]` Path param: Account ID. - `Q param.Field[string]` Query param: Filter scans - `Size param.Field[int64]` Query param: Limit the number of objects in the response. ### Returns - `type ScanListResponse struct{…}` - `Results []ScanListResponseResult` - `ID string` - `Page ScanListResponseResultsPage` - `ASN string` - `Country string` - `IP string` - `URL string` - `Result string` - `Stats ScanListResponseResultsStats` - `DataLength float64` - `Requests float64` - `UniqCountries float64` - `UniqIPs float64` - `Task ScanListResponseResultsTask` - `Time string` - `URL string` - `UUID string` - `Visibility string` - `Verdicts ScanListResponseResultsVerdicts` - `Malicious bool` ### Example ```go 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"), ) scans, err := client.URLScanner.Scans.List(context.TODO(), url_scanner.ScanListParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", scans.Results) } ``` #### Response ```json { "results": [ { "_id": "9626f773-9ffb-4cfb-89d3-30b120fc8011", "page": { "asn": "AS15133", "country": "US", "ip": "93.184.215.14", "url": "https://example.com" }, "result": "https://radar.clouflare.com/scan/9626f773-9ffb-4cfb-89d3-30b120fc8011", "stats": { "dataLength": 2512, "requests": 2, "uniqCountries": 1, "uniqIPs": 1 }, "task": { "time": "2024-09-30T23:54:02.881000+00:00", "url": "https://example.com", "uuid": "9626f773-9ffb-4cfb-89d3-30b120fc8011", "visibility": "public" }, "verdicts": { "malicious": true } } ] } ``` ## Get URL scan `client.URLScanner.Scans.Get(ctx, scanID, query) (*ScanGetResponse, error)` **get** `/accounts/{account_id}/urlscanner/v2/result/{scan_id}` Get URL scan by uuid ### Parameters - `scanID string` Scan UUID. - `query ScanGetParams` - `AccountID param.Field[string]` Account ID. ### Returns - `type ScanGetResponse struct{…}` - `Data ScanGetResponseData` - `Console []ScanGetResponseDataConsole` - `Message ScanGetResponseDataConsoleMessage` - `Level string` - `Source string` - `Text string` - `URL string` - `Cookies []ScanGetResponseDataCookie` - `Domain string` - `Expires float64` - `HTTPOnly bool` - `Name string` - `Path string` - `Priority string` - `SameParty bool` - `Secure bool` - `Session bool` - `Size float64` - `SourcePort float64` - `SourceScheme string` - `Value string` - `Globals []ScanGetResponseDataGlobal` - `Prop string` - `Type string` - `Links []ScanGetResponseDataLink` - `Href string` - `Text string` - `Performance []ScanGetResponseDataPerformance` - `Duration float64` - `EntryType string` - `Name string` - `StartTime float64` - `Requests []ScanGetResponseDataRequest` - `Request ScanGetResponseDataRequestsRequest` - `DocumentURL string` - `HasUserGesture bool` - `Initiator ScanGetResponseDataRequestsRequestInitiator` - `Host string` - `Type string` - `URL string` - `RedirectHasExtraInfo bool` - `Request ScanGetResponseDataRequestsRequestRequest` - `InitialPriority string` - `IsSameSite bool` - `Method string` - `MixedContentType string` - `ReferrerPolicy string` - `URL string` - `Headers unknown` - `RequestID string` - `Type string` - `WallTime float64` - `FrameID string` - `LoaderID string` - `PrimaryRequest bool` - `RedirectResponse ScanGetResponseDataRequestsRequestRedirectResponse` - `Charset string` - `MimeType string` - `Protocol string` - `RemoteIPAddress string` - `RemotePort float64` - `SecurityHeaders []ScanGetResponseDataRequestsRequestRedirectResponseSecurityHeader` - `Name string` - `Value string` - `SecurityState string` - `Status float64` - `StatusText string` - `URL string` - `Headers unknown` - `Response ScanGetResponseDataRequestsResponse` - `ASN ScanGetResponseDataRequestsResponseASN` - `ASN string` - `Country string` - `Description string` - `IP string` - `Name string` - `Org string` - `DataLength float64` - `EncodedDataLength float64` - `Geoip ScanGetResponseDataRequestsResponseGeoip` - `City string` - `Country string` - `CountryName string` - `GeonameID string` - `Ll []float64` - `Region string` - `HasExtraInfo bool` - `RequestID string` - `Response ScanGetResponseDataRequestsResponseResponse` - `Charset string` - `MimeType string` - `Protocol string` - `RemoteIPAddress string` - `RemotePort float64` - `SecurityDetails ScanGetResponseDataRequestsResponseResponseSecurityDetails` - `CertificateID float64` - `CertificateTransparencyCompliance string` - `Cipher string` - `EncryptedClientHello bool` - `Issuer string` - `KeyExchange string` - `KeyExchangeGroup string` - `Protocol string` - `SanList []string` - `ServerSignatureAlgorithm float64` - `SubjectName string` - `ValidFrom float64` - `ValidTo float64` - `SecurityHeaders []ScanGetResponseDataRequestsResponseResponseSecurityHeader` - `Name string` - `Value string` - `SecurityState string` - `Status float64` - `StatusText string` - `URL string` - `Headers unknown` - `Size float64` - `Type string` - `ContentAvailable bool` - `Hash string` - `Requests []ScanGetResponseDataRequestsRequest` - `DocumentURL string` - `FrameID string` - `HasUserGesture bool` - `Initiator ScanGetResponseDataRequestsRequestsInitiator` - `Type string` - `LoaderID string` - `RedirectHasExtraInfo bool` - `Request ScanGetResponseDataRequestsRequestsRequest` - `Headers ScanGetResponseDataRequestsRequestsRequestHeaders` - `Name string` - `InitialPriority string` - `IsSameSite bool` - `Method string` - `MixedContentType string` - `ReferrerPolicy string` - `URL string` - `RequestID string` - `Type string` - `WallTime float64` - `Lists ScanGetResponseLists` - `ASNs []string` - `Certificates []ScanGetResponseListsCertificate` - `Issuer string` - `SubjectName string` - `ValidFrom float64` - `ValidTo float64` - `Continents []string` - `Countries []string` - `Domains []string` - `Hashes []string` - `IPs []string` - `LinkDomains []string` - `Servers []string` - `URLs []string` - `Meta ScanGetResponseMeta` - `Processors ScanGetResponseMetaProcessors` - `ASN ScanGetResponseMetaProcessorsASN` - `Data []ScanGetResponseMetaProcessorsASNData` - `ASN string` - `Country string` - `Description string` - `IP string` - `Name string` - `DNS ScanGetResponseMetaProcessorsDNS` - `Data []ScanGetResponseMetaProcessorsDNSData` - `Address string` - `DNSSECValid bool` - `Name string` - `Type string` - `DomainCategories ScanGetResponseMetaProcessorsDomainCategories` - `Data []ScanGetResponseMetaProcessorsDomainCategoriesData` - `Inherited unknown` - `IsPrimary bool` - `Name string` - `Geoip ScanGetResponseMetaProcessorsGeoip` - `Data []ScanGetResponseMetaProcessorsGeoipData` - `Geoip ScanGetResponseMetaProcessorsGeoipDataGeoip` - `City string` - `Country string` - `CountryName string` - `Ll []float64` - `Region string` - `IP string` - `Phishing ScanGetResponseMetaProcessorsPhishing` - `Data []string` - `RadarRank ScanGetResponseMetaProcessorsRadarRank` - `Data []ScanGetResponseMetaProcessorsRadarRankData` - `Bucket string` - `Hostname string` - `Rank float64` - `Wappa ScanGetResponseMetaProcessorsWappa` - `Data []ScanGetResponseMetaProcessorsWappaData` - `App string` - `Categories []ScanGetResponseMetaProcessorsWappaDataCategory` - `Name string` - `Priority float64` - `Confidence []ScanGetResponseMetaProcessorsWappaDataConfidence` - `Confidence float64` - `Name string` - `Pattern string` - `PatternType string` - `ConfidenceTotal float64` - `Icon string` - `Website string` - `PhishingV2 ScanGetResponseMetaProcessorsPhishingV2` - `Data []string` - `RobotsTXT ScanGetResponseMetaProcessorsRobotsTXT` - `Data []ScanGetResponseMetaProcessorsRobotsTXTData` - `Rules ScanGetResponseMetaProcessorsRobotsTXTDataRules` - `Star ScanGetResponseMetaProcessorsRobotsTXTDataRules` - `Allow []string` - `Disallow []string` - `ContentSignal ScanGetResponseMetaProcessorsRobotsTXTDataRulesContentSignal` - `AIInput string` - `AITrain string` - `Search string` - `CrawlDelay float64` - `Sitemaps []string` - `Hash string` - `URLCategories ScanGetResponseMetaProcessorsURLCategories` - `Data []ScanGetResponseMetaProcessorsURLCategoriesData` - `Content []ScanGetResponseMetaProcessorsURLCategoriesDataContent` - `ID float64` - `Name string` - `SuperCategoryID float64` - `Inherited ScanGetResponseMetaProcessorsURLCategoriesDataInherited` - `Content []ScanGetResponseMetaProcessorsURLCategoriesDataInheritedContent` - `ID float64` - `Name string` - `SuperCategoryID float64` - `From string` - `Risks []ScanGetResponseMetaProcessorsURLCategoriesDataInheritedRisk` - `ID float64` - `Name string` - `SuperCategoryID float64` - `Name string` - `Risks []ScanGetResponseMetaProcessorsURLCategoriesDataRisk` - `ID float64` - `Name string` - `SuperCategoryID float64` - `Page ScanGetResponsePage` - `ApexDomain string` - `ASN string` - `Asnname string` - `City string` - `Country string` - `Domain string` - `IP string` - `MimeType string` - `Server string` - `Status string` - `Title string` - `TLSAgeDays float64` - `TLSIssuer string` - `TLSValidDays float64` - `TLSValidFrom string` - `URL string` - `Screenshot ScanGetResponsePageScreenshot` - `Dhash string` - `Mm3Hash float64` - `Name string` - `Phash string` - `Scanner ScanGetResponseScanner` - `Colo string` - `Country string` - `Stats ScanGetResponseStats` - `DomainStats []ScanGetResponseStatsDomainStat` - `Count float64` - `Countries []string` - `Domain string` - `EncodedSize float64` - `Index float64` - `Initiators []string` - `IPs []string` - `Redirects float64` - `Size float64` - `IPStats []ScanGetResponseStatsIPStat` - `ASN ScanGetResponseStatsIPStatsASN` - `ASN string` - `Country string` - `Description string` - `IP string` - `Name string` - `Org string` - `Countries []string` - `Domains []string` - `EncodedSize float64` - `Geoip ScanGetResponseStatsIPStatsGeoip` - `City string` - `Country string` - `CountryName string` - `Ll []float64` - `Region string` - `Index float64` - `IP string` - `IPV6 bool` - `Redirects float64` - `Requests float64` - `Size float64` - `Count float64` - `IPv6Percentage float64` - `Malicious float64` - `ProtocolStats []ScanGetResponseStatsProtocolStat` - `Count float64` - `Countries []string` - `EncodedSize float64` - `IPs []string` - `Protocol string` - `Size float64` - `ResourceStats []ScanGetResponseStatsResourceStat` - `Compression float64` - `Count float64` - `Countries []string` - `EncodedSize float64` - `IPs []string` - `Percentage float64` - `Size float64` - `Type string` - `SecurePercentage float64` - `SecureRequests float64` - `ServerStats []ScanGetResponseStatsServerStat` - `Count float64` - `Countries []string` - `EncodedSize float64` - `IPs []string` - `Server string` - `Size float64` - `TLSStats []ScanGetResponseStatsTLSStat` - `Count float64` - `Countries []string` - `EncodedSize float64` - `IPs []string` - `Protocols ScanGetResponseStatsTLSStatsProtocols` - `TLS1_3Aes128Gcm float64` - `SecurityState string` - `Size float64` - `TotalLinks float64` - `UniqASNs float64` - `UniqCountries float64` - `Task ScanGetResponseTask` - `ApexDomain string` - `Domain string` - `DOMURL string` - `Method string` - `Options ScanGetResponseTaskOptions` - `CustomHeaders unknown` Custom headers set. - `ScreenshotsResolutions []string` - `ReportURL string` - `ScreenshotURL string` - `Source string` - `Success bool` - `Time string` - `URL string` - `UUID string` - `Visibility string` - `Verdicts ScanGetResponseVerdicts` - `Overall ScanGetResponseVerdictsOverall` - `Categories []string` - `HasVerdicts bool` - `Malicious bool` - `Tags []string` ### Example ```go 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.Get( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", url_scanner.ScanGetParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", scan.Data) } ``` #### Response ```json { "data": { "console": [ { "message": { "level": "level", "source": "source", "text": "text", "url": "url" } } ], "cookies": [ { "domain": "domain", "expires": 0, "httpOnly": true, "name": "name", "path": "path", "priority": "priority", "sameParty": true, "secure": true, "session": true, "size": 0, "sourcePort": 0, "sourceScheme": "sourceScheme", "value": "value" } ], "globals": [ { "prop": "prop", "type": "type" } ], "links": [ { "href": "href", "text": "text" } ], "performance": [ { "duration": 0, "entryType": "entryType", "name": "name", "startTime": 0 } ], "requests": [ { "request": { "documentURL": "documentURL", "hasUserGesture": true, "initiator": { "host": "host", "type": "type", "url": "url" }, "redirectHasExtraInfo": true, "request": { "initialPriority": "initialPriority", "isSameSite": true, "method": "method", "mixedContentType": "mixedContentType", "referrerPolicy": "referrerPolicy", "url": "url", "headers": {} }, "requestId": "requestId", "type": "type", "wallTime": 0, "frameId": "frameId", "loaderId": "loaderId", "primaryRequest": true, "redirectResponse": { "charset": "charset", "mimeType": "mimeType", "protocol": "protocol", "remoteIPAddress": "remoteIPAddress", "remotePort": 0, "securityHeaders": [ { "name": "name", "value": "value" } ], "securityState": "securityState", "status": 0, "statusText": "statusText", "url": "url", "headers": {} } }, "response": { "asn": { "asn": "asn", "country": "country", "description": "description", "ip": "ip", "name": "name", "org": "org" }, "dataLength": 0, "encodedDataLength": 0, "geoip": { "city": "city", "country": "country", "country_name": "country_name", "geonameId": "geonameId", "ll": [ 0 ], "region": "region" }, "hasExtraInfo": true, "requestId": "requestId", "response": { "charset": "charset", "mimeType": "mimeType", "protocol": "protocol", "remoteIPAddress": "remoteIPAddress", "remotePort": 0, "securityDetails": { "certificateId": 0, "certificateTransparencyCompliance": "certificateTransparencyCompliance", "cipher": "cipher", "encryptedClientHello": true, "issuer": "issuer", "keyExchange": "keyExchange", "keyExchangeGroup": "keyExchangeGroup", "protocol": "protocol", "sanList": [ "string" ], "serverSignatureAlgorithm": 0, "subjectName": "subjectName", "validFrom": 0, "validTo": 0 }, "securityHeaders": [ { "name": "name", "value": "value" } ], "securityState": "securityState", "status": 0, "statusText": "statusText", "url": "url", "headers": {} }, "size": 0, "type": "type", "contentAvailable": true, "hash": "hash" }, "requests": [ { "documentURL": "documentURL", "frameId": "frameId", "hasUserGesture": true, "initiator": { "type": "type" }, "loaderId": "loaderId", "redirectHasExtraInfo": true, "request": { "headers": { "name": "name" }, "initialPriority": "initialPriority", "isSameSite": true, "method": "method", "mixedContentType": "mixedContentType", "referrerPolicy": "referrerPolicy", "url": "url" }, "requestId": "requestId", "type": "type", "wallTime": 0 } ] } ] }, "lists": { "asns": [ "string" ], "certificates": [ { "issuer": "issuer", "subjectName": "subjectName", "validFrom": 0, "validTo": 0 } ], "continents": [ "string" ], "countries": [ "string" ], "domains": [ "string" ], "hashes": [ "string" ], "ips": [ "string" ], "linkDomains": [ "string" ], "servers": [ "string" ], "urls": [ "string" ] }, "meta": { "processors": { "asn": { "data": [ { "asn": "asn", "country": "country", "description": "description", "ip": "ip", "name": "name" } ] }, "dns": { "data": [ { "address": "address", "dnssec_valid": true, "name": "name", "type": "type" } ] }, "domainCategories": { "data": [ { "inherited": {}, "isPrimary": true, "name": "name" } ] }, "geoip": { "data": [ { "geoip": { "city": "city", "country": "country", "country_name": "country_name", "ll": [ 0 ], "region": "region" }, "ip": "ip" } ] }, "phishing": { "data": [ "string" ] }, "radarRank": { "data": [ { "bucket": "bucket", "hostname": "hostname", "rank": 0 } ] }, "wappa": { "data": [ { "app": "app", "categories": [ { "name": "name", "priority": 0 } ], "confidence": [ { "confidence": 0, "name": "name", "pattern": "pattern", "patternType": "patternType" } ], "confidenceTotal": 0, "icon": "icon", "website": "website" } ] }, "phishing_v2": { "data": [ "string" ] }, "robotsTxt": { "data": [ { "rules": { "*": { "allow": [ "string" ], "disallow": [ "string" ], "contentSignal": { "ai-input": "no", "ai-train": "yes", "search": "yes" }, "crawlDelay": 0 } }, "sitemaps": [ "string" ], "hash": "hash" } ] }, "urlCategories": { "data": [ { "content": [ { "id": 0, "name": "name", "super_category_id": 0 } ], "inherited": { "content": [ { "id": 0, "name": "name", "super_category_id": 0 } ], "from": "from", "risks": [ { "id": 0, "name": "name", "super_category_id": 0 } ] }, "name": "name", "risks": [ { "id": 0, "name": "name", "super_category_id": 0 } ] } ] } } }, "page": { "apexDomain": "apexDomain", "asn": "asn", "asnname": "asnname", "city": "city", "country": "country", "domain": "domain", "ip": "ip", "mimeType": "mimeType", "server": "server", "status": "200", "title": "title", "tlsAgeDays": 0, "tlsIssuer": "tlsIssuer", "tlsValidDays": 0, "tlsValidFrom": "tlsValidFrom", "url": "url", "screenshot": { "dhash": "dhash", "mm3Hash": 0, "name": "name", "phash": "phash" } }, "scanner": { "colo": "colo", "country": "country" }, "stats": { "domainStats": [ { "count": 0, "countries": [ "string" ], "domain": "domain", "encodedSize": 0, "index": 0, "initiators": [ "string" ], "ips": [ "string" ], "redirects": 0, "size": 0 } ], "ipStats": [ { "asn": { "asn": "asn", "country": "country", "description": "description", "ip": "ip", "name": "name", "org": "org" }, "countries": [ "string" ], "domains": [ "string" ], "encodedSize": 0, "geoip": { "city": "city", "country": "country", "country_name": "country_name", "ll": [ 0 ], "region": "region" }, "index": 0, "ip": "ip", "ipv6": true, "redirects": 0, "requests": 0, "size": 0, "count": 0 } ], "IPv6Percentage": 0, "malicious": 0, "protocolStats": [ { "count": 0, "countries": [ "string" ], "encodedSize": 0, "ips": [ "string" ], "protocol": "protocol", "size": 0 } ], "resourceStats": [ { "compression": 0, "count": 0, "countries": [ "string" ], "encodedSize": 0, "ips": [ "string" ], "percentage": 0, "size": 0, "type": "type" } ], "securePercentage": 0, "secureRequests": 0, "serverStats": [ { "count": 0, "countries": [ "string" ], "encodedSize": 0, "ips": [ "string" ], "server": "server", "size": 0 } ], "tlsStats": [ { "count": 0, "countries": [ "string" ], "encodedSize": 0, "ips": [ "string" ], "protocols": { "TLS 1.3 / AES_128_GCM": 0 }, "securityState": "securityState", "size": 0 } ], "totalLinks": 0, "uniqASNs": 0, "uniqCountries": 0 }, "task": { "apexDomain": "apexDomain", "domain": "domain", "domURL": "domURL", "method": "method", "options": { "customHeaders": {}, "screenshotsResolutions": [ "string" ] }, "reportURL": "reportURL", "screenshotURL": "screenshotURL", "source": "source", "success": true, "time": "time", "url": "url", "uuid": "uuid", "visibility": "visibility" }, "verdicts": { "overall": { "categories": [ "string" ], "hasVerdicts": true, "malicious": true, "tags": [ "string" ] } } } ``` ## Create URL Scan `client.URLScanner.Scans.New(ctx, params) (*ScanNewResponse, error)` **post** `/accounts/{account_id}/urlscanner/v2/scan` Submit a URL to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/. ### Parameters - `params ScanNewParams` - `AccountID param.Field[string]` Path param: Account ID. - `URL param.Field[string]` Body param - `Country param.Field[ScanNewParamsCountry]` Body param: Country to geo egress from - `const ScanNewParamsCountryAf ScanNewParamsCountry = "AF"` - `const ScanNewParamsCountryAl ScanNewParamsCountry = "AL"` - `const ScanNewParamsCountryDz ScanNewParamsCountry = "DZ"` - `const ScanNewParamsCountryAD ScanNewParamsCountry = "AD"` - `const ScanNewParamsCountryAo ScanNewParamsCountry = "AO"` - `const ScanNewParamsCountryAg ScanNewParamsCountry = "AG"` - `const ScanNewParamsCountryAr ScanNewParamsCountry = "AR"` - `const ScanNewParamsCountryAm ScanNewParamsCountry = "AM"` - `const ScanNewParamsCountryAu ScanNewParamsCountry = "AU"` - `const ScanNewParamsCountryAt ScanNewParamsCountry = "AT"` - `const ScanNewParamsCountryAz ScanNewParamsCountry = "AZ"` - `const ScanNewParamsCountryBh ScanNewParamsCountry = "BH"` - `const ScanNewParamsCountryBd ScanNewParamsCountry = "BD"` - `const ScanNewParamsCountryBb ScanNewParamsCountry = "BB"` - `const ScanNewParamsCountryBy ScanNewParamsCountry = "BY"` - `const ScanNewParamsCountryBe ScanNewParamsCountry = "BE"` - `const ScanNewParamsCountryBz ScanNewParamsCountry = "BZ"` - `const ScanNewParamsCountryBj ScanNewParamsCountry = "BJ"` - `const ScanNewParamsCountryBm ScanNewParamsCountry = "BM"` - `const ScanNewParamsCountryBt ScanNewParamsCountry = "BT"` - `const ScanNewParamsCountryBo ScanNewParamsCountry = "BO"` - `const ScanNewParamsCountryBa ScanNewParamsCountry = "BA"` - `const ScanNewParamsCountryBw ScanNewParamsCountry = "BW"` - `const ScanNewParamsCountryBr ScanNewParamsCountry = "BR"` - `const ScanNewParamsCountryBn ScanNewParamsCountry = "BN"` - `const ScanNewParamsCountryBg ScanNewParamsCountry = "BG"` - `const ScanNewParamsCountryBf ScanNewParamsCountry = "BF"` - `const ScanNewParamsCountryBi ScanNewParamsCountry = "BI"` - `const ScanNewParamsCountryKh ScanNewParamsCountry = "KH"` - `const ScanNewParamsCountryCm ScanNewParamsCountry = "CM"` - `const ScanNewParamsCountryCA ScanNewParamsCountry = "CA"` - `const ScanNewParamsCountryCv ScanNewParamsCountry = "CV"` - `const ScanNewParamsCountryKy ScanNewParamsCountry = "KY"` - `const ScanNewParamsCountryCf ScanNewParamsCountry = "CF"` - `const ScanNewParamsCountryTd ScanNewParamsCountry = "TD"` - `const ScanNewParamsCountryCl ScanNewParamsCountry = "CL"` - `const ScanNewParamsCountryCn ScanNewParamsCountry = "CN"` - `const ScanNewParamsCountryCo ScanNewParamsCountry = "CO"` - `const ScanNewParamsCountryKm ScanNewParamsCountry = "KM"` - `const ScanNewParamsCountryCg ScanNewParamsCountry = "CG"` - `const ScanNewParamsCountryCr ScanNewParamsCountry = "CR"` - `const ScanNewParamsCountryCi ScanNewParamsCountry = "CI"` - `const ScanNewParamsCountryHr ScanNewParamsCountry = "HR"` - `const ScanNewParamsCountryCu ScanNewParamsCountry = "CU"` - `const ScanNewParamsCountryCy ScanNewParamsCountry = "CY"` - `const ScanNewParamsCountryCz ScanNewParamsCountry = "CZ"` - `const ScanNewParamsCountryCd ScanNewParamsCountry = "CD"` - `const ScanNewParamsCountryDK ScanNewParamsCountry = "DK"` - `const ScanNewParamsCountryDj ScanNewParamsCountry = "DJ"` - `const ScanNewParamsCountryDm ScanNewParamsCountry = "DM"` - `const ScanNewParamsCountryDo ScanNewParamsCountry = "DO"` - `const ScanNewParamsCountryEc ScanNewParamsCountry = "EC"` - `const ScanNewParamsCountryEg ScanNewParamsCountry = "EG"` - `const ScanNewParamsCountrySv ScanNewParamsCountry = "SV"` - `const ScanNewParamsCountryGq ScanNewParamsCountry = "GQ"` - `const ScanNewParamsCountryEr ScanNewParamsCountry = "ER"` - `const ScanNewParamsCountryEe ScanNewParamsCountry = "EE"` - `const ScanNewParamsCountrySz ScanNewParamsCountry = "SZ"` - `const ScanNewParamsCountryEt ScanNewParamsCountry = "ET"` - `const ScanNewParamsCountryFj ScanNewParamsCountry = "FJ"` - `const ScanNewParamsCountryFi ScanNewParamsCountry = "FI"` - `const ScanNewParamsCountryFr ScanNewParamsCountry = "FR"` - `const ScanNewParamsCountryGa ScanNewParamsCountry = "GA"` - `const ScanNewParamsCountryGe ScanNewParamsCountry = "GE"` - `const ScanNewParamsCountryDe ScanNewParamsCountry = "DE"` - `const ScanNewParamsCountryGh ScanNewParamsCountry = "GH"` - `const ScanNewParamsCountryGr ScanNewParamsCountry = "GR"` - `const ScanNewParamsCountryGl ScanNewParamsCountry = "GL"` - `const ScanNewParamsCountryGd ScanNewParamsCountry = "GD"` - `const ScanNewParamsCountryGt ScanNewParamsCountry = "GT"` - `const ScanNewParamsCountryGn ScanNewParamsCountry = "GN"` - `const ScanNewParamsCountryGw ScanNewParamsCountry = "GW"` - `const ScanNewParamsCountryGy ScanNewParamsCountry = "GY"` - `const ScanNewParamsCountryHt ScanNewParamsCountry = "HT"` - `const ScanNewParamsCountryHn ScanNewParamsCountry = "HN"` - `const ScanNewParamsCountryHu ScanNewParamsCountry = "HU"` - `const ScanNewParamsCountryIs ScanNewParamsCountry = "IS"` - `const ScanNewParamsCountryIn ScanNewParamsCountry = "IN"` - `const ScanNewParamsCountryID ScanNewParamsCountry = "ID"` - `const ScanNewParamsCountryIr ScanNewParamsCountry = "IR"` - `const ScanNewParamsCountryIq ScanNewParamsCountry = "IQ"` - `const ScanNewParamsCountryIe ScanNewParamsCountry = "IE"` - `const ScanNewParamsCountryIl ScanNewParamsCountry = "IL"` - `const ScanNewParamsCountryIt ScanNewParamsCountry = "IT"` - `const ScanNewParamsCountryJm ScanNewParamsCountry = "JM"` - `const ScanNewParamsCountryJp ScanNewParamsCountry = "JP"` - `const ScanNewParamsCountryJo ScanNewParamsCountry = "JO"` - `const ScanNewParamsCountryKz ScanNewParamsCountry = "KZ"` - `const ScanNewParamsCountryKe ScanNewParamsCountry = "KE"` - `const ScanNewParamsCountryKi ScanNewParamsCountry = "KI"` - `const ScanNewParamsCountryKw ScanNewParamsCountry = "KW"` - `const ScanNewParamsCountryKg ScanNewParamsCountry = "KG"` - `const ScanNewParamsCountryLa ScanNewParamsCountry = "LA"` - `const ScanNewParamsCountryLv ScanNewParamsCountry = "LV"` - `const ScanNewParamsCountryLB ScanNewParamsCountry = "LB"` - `const ScanNewParamsCountryLs ScanNewParamsCountry = "LS"` - `const ScanNewParamsCountryLr ScanNewParamsCountry = "LR"` - `const ScanNewParamsCountryLy ScanNewParamsCountry = "LY"` - `const ScanNewParamsCountryLi ScanNewParamsCountry = "LI"` - `const ScanNewParamsCountryLt ScanNewParamsCountry = "LT"` - `const ScanNewParamsCountryLu ScanNewParamsCountry = "LU"` - `const ScanNewParamsCountryMo ScanNewParamsCountry = "MO"` - `const ScanNewParamsCountryMg ScanNewParamsCountry = "MG"` - `const ScanNewParamsCountryMw ScanNewParamsCountry = "MW"` - `const ScanNewParamsCountryMy ScanNewParamsCountry = "MY"` - `const ScanNewParamsCountryMv ScanNewParamsCountry = "MV"` - `const ScanNewParamsCountryMl ScanNewParamsCountry = "ML"` - `const ScanNewParamsCountryMr ScanNewParamsCountry = "MR"` - `const ScanNewParamsCountryMu ScanNewParamsCountry = "MU"` - `const ScanNewParamsCountryMX ScanNewParamsCountry = "MX"` - `const ScanNewParamsCountryFm ScanNewParamsCountry = "FM"` - `const ScanNewParamsCountryMd ScanNewParamsCountry = "MD"` - `const ScanNewParamsCountryMc ScanNewParamsCountry = "MC"` - `const ScanNewParamsCountryMn ScanNewParamsCountry = "MN"` - `const ScanNewParamsCountryMs ScanNewParamsCountry = "MS"` - `const ScanNewParamsCountryMa ScanNewParamsCountry = "MA"` - `const ScanNewParamsCountryMz ScanNewParamsCountry = "MZ"` - `const ScanNewParamsCountryMm ScanNewParamsCountry = "MM"` - `const ScanNewParamsCountryNa ScanNewParamsCountry = "NA"` - `const ScanNewParamsCountryNr ScanNewParamsCountry = "NR"` - `const ScanNewParamsCountryNp ScanNewParamsCountry = "NP"` - `const ScanNewParamsCountryNl ScanNewParamsCountry = "NL"` - `const ScanNewParamsCountryNz ScanNewParamsCountry = "NZ"` - `const ScanNewParamsCountryNi ScanNewParamsCountry = "NI"` - `const ScanNewParamsCountryNe ScanNewParamsCountry = "NE"` - `const ScanNewParamsCountryNg ScanNewParamsCountry = "NG"` - `const ScanNewParamsCountryKp ScanNewParamsCountry = "KP"` - `const ScanNewParamsCountryMk ScanNewParamsCountry = "MK"` - `const ScanNewParamsCountryNo ScanNewParamsCountry = "NO"` - `const ScanNewParamsCountryOm ScanNewParamsCountry = "OM"` - `const ScanNewParamsCountryPk ScanNewParamsCountry = "PK"` - `const ScanNewParamsCountryPs ScanNewParamsCountry = "PS"` - `const ScanNewParamsCountryPa ScanNewParamsCountry = "PA"` - `const ScanNewParamsCountryPg ScanNewParamsCountry = "PG"` - `const ScanNewParamsCountryPy ScanNewParamsCountry = "PY"` - `const ScanNewParamsCountryPe ScanNewParamsCountry = "PE"` - `const ScanNewParamsCountryPh ScanNewParamsCountry = "PH"` - `const ScanNewParamsCountryPl ScanNewParamsCountry = "PL"` - `const ScanNewParamsCountryPt ScanNewParamsCountry = "PT"` - `const ScanNewParamsCountryQa ScanNewParamsCountry = "QA"` - `const ScanNewParamsCountryRo ScanNewParamsCountry = "RO"` - `const ScanNewParamsCountryRu ScanNewParamsCountry = "RU"` - `const ScanNewParamsCountryRw ScanNewParamsCountry = "RW"` - `const ScanNewParamsCountrySh ScanNewParamsCountry = "SH"` - `const ScanNewParamsCountryKn ScanNewParamsCountry = "KN"` - `const ScanNewParamsCountryLc ScanNewParamsCountry = "LC"` - `const ScanNewParamsCountryVc ScanNewParamsCountry = "VC"` - `const ScanNewParamsCountryWs ScanNewParamsCountry = "WS"` - `const ScanNewParamsCountrySm ScanNewParamsCountry = "SM"` - `const ScanNewParamsCountrySt ScanNewParamsCountry = "ST"` - `const ScanNewParamsCountrySa ScanNewParamsCountry = "SA"` - `const ScanNewParamsCountrySn ScanNewParamsCountry = "SN"` - `const ScanNewParamsCountryRs ScanNewParamsCountry = "RS"` - `const ScanNewParamsCountrySc ScanNewParamsCountry = "SC"` - `const ScanNewParamsCountrySl ScanNewParamsCountry = "SL"` - `const ScanNewParamsCountrySk ScanNewParamsCountry = "SK"` - `const ScanNewParamsCountrySi ScanNewParamsCountry = "SI"` - `const ScanNewParamsCountrySb ScanNewParamsCountry = "SB"` - `const ScanNewParamsCountrySo ScanNewParamsCountry = "SO"` - `const ScanNewParamsCountryZa ScanNewParamsCountry = "ZA"` - `const ScanNewParamsCountryKr ScanNewParamsCountry = "KR"` - `const ScanNewParamsCountrySS ScanNewParamsCountry = "SS"` - `const ScanNewParamsCountryEs ScanNewParamsCountry = "ES"` - `const ScanNewParamsCountryLk ScanNewParamsCountry = "LK"` - `const ScanNewParamsCountrySd ScanNewParamsCountry = "SD"` - `const ScanNewParamsCountrySr ScanNewParamsCountry = "SR"` - `const ScanNewParamsCountrySe ScanNewParamsCountry = "SE"` - `const ScanNewParamsCountryCh ScanNewParamsCountry = "CH"` - `const ScanNewParamsCountrySy ScanNewParamsCountry = "SY"` - `const ScanNewParamsCountryTw ScanNewParamsCountry = "TW"` - `const ScanNewParamsCountryTj ScanNewParamsCountry = "TJ"` - `const ScanNewParamsCountryTz ScanNewParamsCountry = "TZ"` - `const ScanNewParamsCountryTh ScanNewParamsCountry = "TH"` - `const ScanNewParamsCountryBs ScanNewParamsCountry = "BS"` - `const ScanNewParamsCountryGm ScanNewParamsCountry = "GM"` - `const ScanNewParamsCountryTl ScanNewParamsCountry = "TL"` - `const ScanNewParamsCountryTg ScanNewParamsCountry = "TG"` - `const ScanNewParamsCountryTo ScanNewParamsCountry = "TO"` - `const ScanNewParamsCountryTt ScanNewParamsCountry = "TT"` - `const ScanNewParamsCountryTn ScanNewParamsCountry = "TN"` - `const ScanNewParamsCountryTr ScanNewParamsCountry = "TR"` - `const ScanNewParamsCountryTm ScanNewParamsCountry = "TM"` - `const ScanNewParamsCountryUg ScanNewParamsCountry = "UG"` - `const ScanNewParamsCountryUA ScanNewParamsCountry = "UA"` - `const ScanNewParamsCountryAe ScanNewParamsCountry = "AE"` - `const ScanNewParamsCountryGB ScanNewParamsCountry = "GB"` - `const ScanNewParamsCountryUs ScanNewParamsCountry = "US"` - `const ScanNewParamsCountryUy ScanNewParamsCountry = "UY"` - `const ScanNewParamsCountryUz ScanNewParamsCountry = "UZ"` - `const ScanNewParamsCountryVu ScanNewParamsCountry = "VU"` - `const ScanNewParamsCountryVe ScanNewParamsCountry = "VE"` - `const ScanNewParamsCountryVn ScanNewParamsCountry = "VN"` - `const ScanNewParamsCountryYe ScanNewParamsCountry = "YE"` - `const ScanNewParamsCountryZm ScanNewParamsCountry = "ZM"` - `const ScanNewParamsCountryZw ScanNewParamsCountry = "ZW"` - `Customagent param.Field[string]` Body param - `CustomHeaders param.Field[map[string, string]]` Body param: Set custom headers. - `Referer param.Field[string]` Body param - `ScreenshotsResolutions param.Field[[]ScanNewParamsScreenshotsResolution]` Body param: Take multiple screenshots targeting different device types. - `const ScanNewParamsScreenshotsResolutionDesktop ScanNewParamsScreenshotsResolution = "desktop"` - `const ScanNewParamsScreenshotsResolutionMobile ScanNewParamsScreenshotsResolution = "mobile"` - `const ScanNewParamsScreenshotsResolutionTablet ScanNewParamsScreenshotsResolution = "tablet"` - `Visibility param.Field[ScanNewParamsVisibility]` 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. - `const ScanNewParamsVisibilityPublic ScanNewParamsVisibility = "Public"` - `const ScanNewParamsVisibilityUnlisted ScanNewParamsVisibility = "Unlisted"` ### Returns - `type ScanNewResponse struct{…}` - `API string` URL to api report. - `Message string` - `Result string` Public URL to report. - `URL string` Canonical form of submitted URL. Use this if you want to later search by URL. - `UUID string` Scan ID. - `Visibility ScanNewResponseVisibility` Submitted visibility status. - `const ScanNewResponseVisibilityPublic ScanNewResponseVisibility = "public"` - `const ScanNewResponseVisibilityUnlisted ScanNewResponseVisibility = "unlisted"` - `Options ScanNewResponseOptions` - `Useragent string` ### Example ```go 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) } ``` #### Response ```json { "api": "api", "message": "Submission successful", "result": "result", "url": "url", "uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "visibility": "public", "options": { "useragent": "useragent" } } ``` ## Bulk create URL Scans `client.URLScanner.Scans.BulkNew(ctx, params) (*[]ScanBulkNewResponse, error)` **post** `/accounts/{account_id}/urlscanner/v2/bulk` Submit URLs to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/ and take into account scans submitted in bulk have lower priority and may take longer to finish. ### Parameters - `params ScanBulkNewParams` - `AccountID param.Field[string]` Path param: Account ID. - `Body param.Field[[]ScanBulkNewParamsBody]` Body param: List of urls to scan (up to a 100). - `URL string` - `Customagent string` - `CustomHeaders map[string, string]` Set custom headers. - `Referer string` - `ScreenshotsResolutions []ScanBulkNewParamsBodyScreenshotsResolution` Take multiple screenshots targeting different device types. - `const ScanBulkNewParamsBodyScreenshotsResolutionDesktop ScanBulkNewParamsBodyScreenshotsResolution = "desktop"` - `const ScanBulkNewParamsBodyScreenshotsResolutionMobile ScanBulkNewParamsBodyScreenshotsResolution = "mobile"` - `const ScanBulkNewParamsBodyScreenshotsResolutionTablet ScanBulkNewParamsBodyScreenshotsResolution = "tablet"` - `Visibility ScanBulkNewParamsBodyVisibility` 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. - `const ScanBulkNewParamsBodyVisibilityPublic ScanBulkNewParamsBodyVisibility = "Public"` - `const ScanBulkNewParamsBodyVisibilityUnlisted ScanBulkNewParamsBodyVisibility = "Unlisted"` ### Returns - `type ScanBulkNewResponse []ScanBulkNewResponse` - `API string` URL to api report. - `Result string` URL to report. - `URL string` Submitted URL - `UUID string` Scan ID. - `Visibility ScanBulkNewResponseVisibility` Submitted visibility status. - `const ScanBulkNewResponseVisibilityPublic ScanBulkNewResponseVisibility = "public"` - `const ScanBulkNewResponseVisibilityUnlisted ScanBulkNewResponseVisibility = "unlisted"` - `Options ScanBulkNewResponseOptions` - `Useragent string` ### Example ```go 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"), ) response, err := client.URLScanner.Scans.BulkNew(context.TODO(), url_scanner.ScanBulkNewParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json [ { "api": "api", "result": "result", "url": "url", "uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "visibility": "public", "options": { "useragent": "useragent" } } ] ``` ## Get URL scan's HAR `client.URLScanner.Scans.HAR(ctx, scanID, query) (*ScanHARResponse, error)` **get** `/accounts/{account_id}/urlscanner/v2/har/{scan_id}` Get a URL scan's HAR file. See HAR spec at http://www.softwareishard.com/blog/har-12-spec/. ### Parameters - `scanID string` Scan UUID. - `query ScanHARParams` - `AccountID param.Field[string]` Account ID. ### Returns - `type ScanHARResponse struct{…}` - `Log ScanHARResponseLog` - `Creator ScanHARResponseLogCreator` - `Comment string` - `Name string` - `Version string` - `Entries []ScanHARResponseLogEntry` - `InitialPriority string` - `InitiatorType string` - `Priority string` - `RequestID string` - `RequestTime float64` - `ResourceType string` - `Cache unknown` - `Connection string` - `Pageref string` - `Request ScanHARResponseLogEntriesRequest` - `BodySize float64` - `Headers []ScanHARResponseLogEntriesRequestHeader` - `Name string` - `Value string` - `HeadersSize float64` - `HTTPVersion string` - `Method string` - `URL string` - `Response ScanHARResponseLogEntriesResponse` - `TransferSize float64` - `BodySize float64` - `Content ScanHARResponseLogEntriesResponseContent` - `MimeType string` - `Size float64` - `Compression int64` - `Headers []ScanHARResponseLogEntriesResponseHeader` - `Name string` - `Value string` - `HeadersSize float64` - `HTTPVersion string` - `RedirectURL string` - `Status float64` - `StatusText string` - `ServerIPAddress string` - `StartedDateTime string` - `Time float64` - `Pages []ScanHARResponseLogPage` - `ID string` - `PageTimings ScanHARResponseLogPagesPageTimings` - `OnContentLoad float64` - `OnLoad float64` - `StartedDateTime string` - `Title string` - `Version string` ### Example ```go 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"), ) response, err := client.URLScanner.Scans.HAR( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", url_scanner.ScanHARParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Log) } ``` #### Response ```json { "log": { "creator": { "comment": "https://github.com/sitespeedio/chrome-har", "name": "chrome-har", "version": "0.13.1" }, "entries": [ { "_initialPriority": "VeryHigh", "_initiator_type": "other", "_priority": "VeryHigh", "_requestId": "DDC779F0CB3746BAF283EC1A51B0F2F8", "_requestTime": 114135.331081, "_resourceType": "document", "cache": {}, "connection": "33", "pageref": "page_1", "request": { "bodySize": 0, "headers": [ { "name": "Upgrade-Insecure-Requests", "value": "1" } ], "headersSize": 197, "httpVersion": "http/1.1", "method": "GET", "url": "http://example.com/" }, "response": { "_transferSize": 1071, "bodySize": 648, "content": { "mimeType": "text/html", "size": 1256, "compression": 608 }, "headers": [ { "name": "Content-Encoding", "value": "gzip" } ], "headersSize": 423, "httpVersion": "http/1.1", "redirectURL": "redirectURL", "status": 200, "statusText": "OK" }, "serverIPAddress": "2606:2800:220:1:248:1893:25c8:1946", "startedDateTime": "2023-05-03T17:05:13.196Z", "time": 268.64 } ], "pages": [ { "id": "page_1", "pageTimings": { "onContentLoad": 305.408, "onLoad": 305.169 }, "startedDateTime": "2023-05-03T17:05:13.195Z", "title": "http://example.com/" } ], "version": "1.2" } } ``` ## Get screenshot `client.URLScanner.Scans.Screenshot(ctx, scanID, params) (*Response, error)` **get** `/accounts/{account_id}/urlscanner/v2/screenshots/{scan_id}.png` Get scan's screenshot by resolution (desktop/mobile/tablet). ### Parameters - `scanID string` Scan UUID. - `params ScanScreenshotParams` - `AccountID param.Field[string]` Path param: Account ID. - `Resolution param.Field[ScanScreenshotParamsResolution]` Query param: Target device type. - `const ScanScreenshotParamsResolutionDesktop ScanScreenshotParamsResolution = "desktop"` - `const ScanScreenshotParamsResolutionMobile ScanScreenshotParamsResolution = "mobile"` - `const ScanScreenshotParamsResolutionTablet ScanScreenshotParamsResolution = "tablet"` ### Returns - `type ScanScreenshotResponse interface{…}` ### Example ```go 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"), ) response, err := client.URLScanner.Scans.Screenshot( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", url_scanner.ScanScreenshotParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` ## Get URL scan's DOM `client.URLScanner.Scans.DOM(ctx, scanID, query) (*string, error)` **get** `/accounts/{account_id}/urlscanner/v2/dom/{scan_id}` Returns a plain text response, with the scan's DOM content as rendered by Chrome. ### Parameters - `scanID string` Scan UUID. - `query ScanDOMParams` - `AccountID param.Field[string]` Account ID. ### Returns - `type ScanDOMResponse string` HTML of webpage. ### Example ```go 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"), ) response, err := client.URLScanner.Scans.DOM( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", url_scanner.ScanDOMParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ```