AI-generated Key Takeaways
-
The condensed APIs Explorer is usually visible on the right side of documentation pages, and you can click "Try it!" if it's not.
-
The expanded version of the APIs Explorer shows code samples and is accessed by clicking "Full screen".
-
You can execute API methods in the APIs Explorer by entering parameters and clicking "Execute", but you need to generate your own authorization credentials to run code samples.
-
Common errors like 401 or 403 can occur if you use the wrong authorization type or scope.
-
Ensure your browser allows popups for the authorization dialog to appear and grant access.
On most documentation pages, a condensed APIs Explorer is visible on the right-hand side of the screen. If the APIs Explorer isn't visible, click Try it! to display the condensed version of the APIs Explorer.
If Try it! doesn't appear on the right-hand side of a reference documentation page, the method isn't supported by the APIs Explorer. For example, the APIs Explorer isn't compatible with APIs that require service accounts, so it doesn't appear on documentation pages for those APIs.
Display the expanded version of the APIs Explorer
The expanded version of the APIs Explorer contains cURL, HTTP, and possibly other code samples. To display the expanded version of the APIs Explorer, click Full screen
.Execute a method
The APIs Explorer lets you enter required parameters, optional parameters,
and, if applicable, a request body for API methods. For many REST methods,
such as list methods, you only need to fill one or two fields before you can
execute the method. For example, the Books API's
books.volumes.list
method only requires a query parameter (q
) to list books. To try the
books.volumes.list
method:
- Navigate to
books.volumes.list
. - If the APIs Explorer isn't displayed, click Try it!
- In the
q
field, type Hunger Games (without any quotes or special characters). - Scroll down and click Execute.
- (optional) A Google sign-in screen asks you to select a Google account.
- (optional) A Google authorization dialog asks you if it's okay to "Manage your books." Click Allow. The results appear below the Execute button.
If the APIs Explorer shows a result of 200, then the method was successful.
Troubleshoot APIs Explorer issues
You received a 401 or 403 error
If you're getting a 401 or 403 error when executing a method using the APIs Explorer, it is likely due to a problem with one of the following:
- You're using the wrong authorization type (API key instead of OAuth 2.0). Try switching the authorization type.
- You're using OAuth 2.0, but with too narrow a scope. Try using a broader scope.
Authorization dialog doesn't appear
The APIs Explorer uses a popup to grant access to your private data. If your browser blocks popups, this popup won't appear and you won't be able to grant access.
If you click Allow in the authorization dialog and nothing happens, try changing your browser's popup settings to enable popups.