Webmaster level: advanced
Just over a year ago we introduced a new
API for website verification for Google services. In the spirit of keeping things simple and focusing our efforts, we've decided to deprecate the
old verification API method on March 31st, 2014. The rest of the API will remain unchanged, this only affects the verification method. For more information about verification in general, please see our
site verification Help Center article.
One advantage of upgrading to the new API for verification is that it uses the same client libraries as most other Google APIs, which simplifies integration with other apps and tools. Getting started is easy, especially if you're used to other Google APIs:
- Download the Google API client library for your favorite programming language.
- Learn about the Site Verification API and its methods.
- Allow your users to authenticate with OAuth.
- Start verifying!
If you can't wait to try it out and are a fan of command lines, here's a shortcut:
- Download and install oacurl.
- Authenticate with a Google Account:
$ java -cp oacurl-1.2.0.jar com.google.oacurl.Login \
--scope https://www.googleapis.com/auth/siteverification
- Request the verification information:
$ echo '{ "verificationMethod": "FILE", "site": {
"identifier": "http://www.example.com",
"type": "SITE" } }' | \
java -cp oacurl-1.2.0.jar com.google.oacurl.Fetch \
'https://www.googleapis.com/siteVerification/v1/token' \
--content-type JSON -X=POST
- Create & add the file to your website, then verify:
$ echo '{ "site": { "identifier": "http://www.example.com",
"type": "SITE" } }' | \
java -cp oacurl-1.2.0.jar com.google.oacurl.Fetch \
'https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=FILE' \
--content-type JSON -X=POST
- Done!
We hope this API will make it easier to implement Google site verification in your projects. Should you have any questions, feel free to comment here, or post in our
Webmaster Help Forum.
Posted by John Mueller, fan of long command lines & Webmaster Trends Analyst