arrow_back

APIs Explorer: Qwik Start

登录 加入
访问 700 多个实验和课程

APIs Explorer: Qwik Start

实验 30 分钟 universal_currency_alt 1 个积分 show_chart 入门级
info 此实验可能会提供 AI 工具来支持您学习。
访问 700 多个实验和课程

GSP277

Google Cloud self-paced labs logo

Overview

The Google APIs Explorer is a tool that lets you explore various Google API methods without writing code. With the APIs Explorer you can:

  • Browse quickly through available APIs and versions.
  • See methods available for each API and what parameters they support along with inline documentation.
  • Execute requests for any method and see responses in real time.
  • Make authenticated and authorized API calls.
  • Search across all services, methods, and your recent requests to quickly find what you are looking for.

The APIs Explorer uses its own API keys whenever it makes a request. When you use the APIs Explorer to make a request, it displays the request syntax, which includes a placeholder labeled {YOUR_API_KEY}. If you want to make the same request in your application, you need to replace this placeholder with your own API key.

Objectives

  • Create a Cloud Storage bucket.
  • Upload an image to Cloud Storage and make it public.
  • Make a request to the Vision API with that image.

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).

    The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details pane.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details pane.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field. Navigation menu icon and Search field

Task 1. Create a Cloud Storage bucket

  1. In the Cloud console, go to Cloud Storage > Buckets.
  2. Click Create bucket.
  3. Give your bucket a unique name. Do not include sensitive information in the bucket name - the bucket namespace is global and publicly visible. For example, -bucket.
  4. Click Choose how to control access to objects.
  5. Uncheck Enforce public access prevention on this bucket.
  6. Select Fine-grained Access control.
  7. Click Create.

Test completed task

Click Check my progress to verify your performed task. If you have successfully created a Cloud Storage bucket, you will see an assessment score.

Create a Cloud Storage bucket.

Task 2. Upload an image

You'll be asking the Cloud Vision API to analyze an image through API Explorer. First, add an image to your bucket for it to analyze. You can use one of your own, or download the image below to your computer and save it as demo-image.jpg .

Dog Image

  1. In your bucket, click Upload > Upload Files and select the demo-image.jpg file you saved.

Bucket details page in Cloud Storage with UPLOAD FILES text highlighted

Test completed task

Click Check my progress to verify your performed task. If you have successfully uploaded an image in a storage bucket, you will see an assessment score.

Upload an image in a storage bucket (demo-image.jpg).

After the file is uploaded and listed in your bucket, share the image publicly by following these steps:

  1. Click the three vertical dot object overflow menu associated with your image.
  2. Select Edit access from the drop-down menu.
  3. In the overlay that appears, click the + Add entry button.
  4. Add a permission for allUsers.
    • Select Public for the Entity.
    • Enter allUsers for the Name.
    • Select Reader for the Access.
  5. Click Save.

Test completed task

Click Check my progress to verify your performed task. If you have successfully made the uploaded image publicly accessible, you will see an assessment score.

Make the uploaded image publicly accessible.

You should see that the image is now public. You're ready to use the API Explorer.

Task 3. Make a request to the Cloud Vision API service

  1. Go to Navigation menu > APIs & Services.

  2. Click + ENABLE APIS AND SERVICES, search for Cloud Vision, then select the Cloud Vision API from the results list and click on it.

  3. Make sure that API is enabled, if not click Enable.

  4. Open the Cloud Vision - Try this API link.

This will open a new tab with the APIs Explorer page loaded.

You will now be on the APIs Explorer page.

Note: In the section below the images.annotate method from Cloud Vision API is being used. You can view all API versions and its method on Cloud Vision API reference.
  1. Click inside of the curly braces in the Request body field.
  2. You'll be asked to select a property - choose "requests". This will generate the next level.
  3. Click inside the brackets and click the blue plus sign icon, select [Add Item] - for your property select "features".
  4. Inside "features" click inside the curly brace, click the blue plus icon and select [Add Item], select "type"; next to it select LABEL_DETECTION.
  5. You should have the blue plus icon at the end of the "features" block where you can choose to add "image"; then add "source", and "imageUri".
  6. Next to "imageUri" enter the path to the image file in your bucket. The path should look like this: gs://MY_BUCKET/demo-image.jpg

When you're done, your Request body field should look like this:

The Request body field, which includes the type: LABEL_DETECTION.

  1. Make sure that Google OAuth 2.0 and API key checkboxes are selected under Credentials section.
Note: To view Credentials FAQs, click on question mark icon next to Credentials title.
  1. On the right panel of an API Explorer console, you can see Cloud Vision API call with cURL, HTTP and JAVASCRIPT.

  2. Now click Execute.

  3. Select your student account.

  4. On the next screen, click Allow to give APIs Explorer access.

The results of Cloud Vision API analysis of the image will be below to your right panel. The top part of the results should look like this:

The results of the Cloud Vision API analysis.

Task 4. Test your understanding

Try these multiple-choice questions to reinforce your understanding of this lab's concepts. Answer them to the best of your abilities.

Congratulations!

You've made your first images.annotate request to the Cloud Vision API service.

Take your next lab

This lab is part of a series of labs called Qwik Starts. These labs are designed to give you a little taste of the many features available with Google Cloud. Search for "Qwik Starts" in the lab catalog to find the next lab you'd like to take!

Next steps / learn more

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

End your lab

When you have completed your lab, click End Lab. Your account and the resources you've used are removed from the lab platform.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Manual Last Updated November 4, 2024

Lab Last Tested November 4, 2024

Copyright 2025 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

准备工作

  1. 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
  2. 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
  3. 在屏幕左上角,点击开始实验即可开始

使用无痕浏览模式

  1. 复制系统为实验提供的用户名密码
  2. 在无痕浏览模式下,点击打开控制台

登录控制台

  1. 使用您的实验凭证登录。使用其他凭证可能会导致错误或产生费用。
  2. 接受条款,并跳过恢复资源页面
  3. 除非您已完成此实验或想要重新开始,否则请勿点击结束实验,因为点击后系统会清除您的工作并移除该项目

此内容目前不可用

一旦可用,我们会通过电子邮件告知您

太好了!

一旦可用,我们会通过电子邮件告知您

一次一个实验

确认结束所有现有实验并开始此实验

使用无痕浏览模式运行实验

请使用无痕模式或无痕式浏览器窗口运行此实验。这可以避免您的个人账号与学生账号之间发生冲突,这种冲突可能导致您的个人账号产生额外费用。