Google OAuth2 API
googleapis · Analytics
Obtains end-user authorization grants for use with other Google APIs.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
oauth2.userinfo.get
https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/userinfo?alt=json&key=YOUR_API_KEY&fields=example&userIp=example"aUser=example&oauth_token=example&prettyPrint=true
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/userinfo?alt=json&key=YOUR_API_KEY&fields=example&userIp=example"aUser=example&oauth_token=example&prettyPrint=true"
import requests
params = {
"alt": "json",
"key": "YOUR_API_KEY",
"fields": "example",
"userIp": "example",
"quotaUser": "example",
"oauth_token": "example",
"prettyPrint": "true"
}
response = requests.get(
"https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/userinfo",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/userinfo');
url.searchParams.set('alt', 'json');
url.searchParams.set('key', 'YOUR_API_KEY');
url.searchParams.set('fields', 'example');
url.searchParams.set('userIp', 'example');
url.searchParams.set('quotaUser', 'example');
url.searchParams.set('oauth_token', 'example');
url.searchParams.set('prettyPrint', 'true');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/userinfo")
q := baseURL.Query()
q.Set("alt", "json")
q.Set("key", "YOUR_API_KEY")
q.Set("fields", "example")
q.Set("userIp", "example")
q.Set("quotaUser", "example")
q.Set("oauth_token", "example")
q.Set("prettyPrint", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/userinfo")
uri.query = URI.encode_www_form({
"alt" => "json",
"key" => "YOUR_API_KEY",
"fields" => "example",
"userIp" => "example",
"quotaUser" => "example",
"oauth_token" => "example",
"prettyPrint" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/userinfo?" . http_build_query([
"alt" => "json",
"key" => "YOUR_API_KEY",
"fields" => "example",
"userIp" => "example",
"quotaUser" => "example",
"oauth_token" => "example",
"prettyPrint" => "true"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
oauth2.userinfo.v2.me.get
https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/userinfo/v2/me?alt=json&key=YOUR_API_KEY&fields=example&userIp=example"aUser=example&oauth_token=example&prettyPrint=true
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/userinfo/v2/me?alt=json&key=YOUR_API_KEY&fields=example&userIp=example"aUser=example&oauth_token=example&prettyPrint=true"
import requests
params = {
"alt": "json",
"key": "YOUR_API_KEY",
"fields": "example",
"userIp": "example",
"quotaUser": "example",
"oauth_token": "example",
"prettyPrint": "true"
}
response = requests.get(
"https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/userinfo/v2/me",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/userinfo/v2/me');
url.searchParams.set('alt', 'json');
url.searchParams.set('key', 'YOUR_API_KEY');
url.searchParams.set('fields', 'example');
url.searchParams.set('userIp', 'example');
url.searchParams.set('quotaUser', 'example');
url.searchParams.set('oauth_token', 'example');
url.searchParams.set('prettyPrint', 'true');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/userinfo/v2/me")
q := baseURL.Query()
q.Set("alt", "json")
q.Set("key", "YOUR_API_KEY")
q.Set("fields", "example")
q.Set("userIp", "example")
q.Set("quotaUser", "example")
q.Set("oauth_token", "example")
q.Set("prettyPrint", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/userinfo/v2/me")
uri.query = URI.encode_www_form({
"alt" => "json",
"key" => "YOUR_API_KEY",
"fields" => "example",
"userIp" => "example",
"quotaUser" => "example",
"oauth_token" => "example",
"prettyPrint" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/userinfo/v2/me?" . http_build_query([
"alt" => "json",
"key" => "YOUR_API_KEY",
"fields" => "example",
"userIp" => "example",
"quotaUser" => "example",
"oauth_token" => "example",
"prettyPrint" => "true"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
POST
oauth2.tokeninfo
https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/tokeninfo?alt=json&key=YOUR_API_KEY&fields=example&userIp=example&id_token=example"aUser=example&oauth_token=example&prettyPrint=true&access_token=example
Hover any highlighted part to learn what it does
curl -X POST "https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/tokeninfo?alt=json&key=YOUR_API_KEY&fields=example&userIp=example&id_token=example"aUser=example&oauth_token=example&prettyPrint=true&access_token=example"
import requests
params = {
"alt": "json",
"key": "YOUR_API_KEY",
"fields": "example",
"userIp": "example",
"id_token": "example",
"quotaUser": "example",
"oauth_token": "example",
"prettyPrint": "true",
"access_token": "example"
}
response = requests.post(
"https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/tokeninfo",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/tokeninfo');
url.searchParams.set('alt', 'json');
url.searchParams.set('key', 'YOUR_API_KEY');
url.searchParams.set('fields', 'example');
url.searchParams.set('userIp', 'example');
url.searchParams.set('id_token', 'example');
url.searchParams.set('quotaUser', 'example');
url.searchParams.set('oauth_token', 'example');
url.searchParams.set('prettyPrint', 'true');
url.searchParams.set('access_token', 'example');
const response = await fetch(url, {
method: 'POST',
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/tokeninfo")
q := baseURL.Query()
q.Set("alt", "json")
q.Set("key", "YOUR_API_KEY")
q.Set("fields", "example")
q.Set("userIp", "example")
q.Set("id_token", "example")
q.Set("quotaUser", "example")
q.Set("oauth_token", "example")
q.Set("prettyPrint", "true")
q.Set("access_token", "example")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("POST", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/tokeninfo")
uri.query = URI.encode_www_form({
"alt" => "json",
"key" => "YOUR_API_KEY",
"fields" => "example",
"userIp" => "example",
"id_token" => "example",
"quotaUser" => "example",
"oauth_token" => "example",
"prettyPrint" => "true",
"access_token" => "example"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/googleapis.com/oauth2/v2/oauth2/v2/tokeninfo?" . http_build_query([
"alt" => "json",
"key" => "YOUR_API_KEY",
"fields" => "example",
"userIp" => "example",
"id_token" => "example",
"quotaUser" => "example",
"oauth_token" => "example",
"prettyPrint" => "true",
"access_token" => "example"
]);
$opts = ["http" => [
"method" => "POST",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with Google OAuth2 API?
Google OAuth2 API is a Analytics API. Developers commonly use analytics APIs for:
- tracking product usage and user behaviour
- building custom reporting and BI dashboards
- measuring marketing and campaign performance
- running funnel, retention, and cohort analysis
- aggregating metrics from multiple data sources
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. Google OAuth2 API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide