Jump to content

Recommended Posts

Posted

Hello,

I've thousands of URLs to check them these are safe, malware infected or any other type of error, that's why I searched and found Google Safe browsing API with this we can send HTTP GET request so different code will return to make us clear is it our sent URL is safe or not. Please guide me how can i make this possible I know basics of Auotit but don't know how to use this API to fulfill above mentioned purpose. Your help will be much appreciated. Thanks

Here is API URL;

https://developers.google.com/safe-browsing/v3/lookup-guide

Posted (edited)
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", "WEBSITE_HERE", False)
$oHTTP.Send()

$oStatusCode = $oHTTP.Status

ConsoleWrite($oStatusCode & @CRLF)

You need the API key, then you can replace WEBSITE_HERE with the complete URL like:

https://sb-ssl.google.com/safebrowsing/api/lookup?client=demo-app&key=12345&appver=1.5.2&pver=3.1&url=http%3A%2F%2Fianfette.org%2F

 

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Posted
38 minutes ago, Terenz said:
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", "WEBSITE_HERE", False)
$oHTTP.Send()

$oStatusCode = $oHTTP.Status

ConsoleWrite($oStatusCode & @CRLF)

You need the API key, then you can replace WEBSITE_HERE with the complete URL like:

https://sb-ssl.google.com/safebrowsing/api/lookup?client=demo-app&key=12345&appver=1.5.2&pver=3.1&url=http%3A%2F%2Fianfette.org%2F

Thanks for kind response:

but then I start this, I got 403 response even I put working key but not able to get required response

here is code;

$oHTTP.Open("GET", "https://sb-ssl.google.com/safebrowsing/api/lookup?client=AdminCP&key=MYKEY&appver=1.5.2&pver=3.1&url=http%3A%2F%2Fexample.com", False)

Quoted somewhere by google;

HTTP Status Codes

HTTP status codes the server can generate in response to an HTTP POST or HTTP GET request:

  • 200 OK: Successful request.
  • 400 Bad Request: Invalid argument (invalid request payload).
  • 403 Forbidden: Permission denied (invalid API key/quota exceeded).
  • 500 Internal Server Error: Internal server error (retry your request).
  • 503 Service Unavailable: Unavailable.
  • 504 Gateway Timeout: Deadline exceeded (retry your request).
Posted

Hello,

I never used any quota even if you use anything or get anything ever then you can considered might have been used but this is my first time I activate API and got its keys and asked autoit experts for help and when i tried i got this error.

even i tried after sometime nothing happen same response don't know why but it's happening all the time 403 error.

 

  • Developers
Posted (edited)

You likely are only allowed to query the API an X number of times per day (Quota), just check that on their site.
Also first make it work in a browser manually before trying to automate it.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...