Google Cloud API를 처음 사용하는 경우 이 가이드의 단계에 따라 curl 명령어를 사용하여 API를 호출할 수 있습니다. 애플리케이션을 개발하기 전에 curl 명령어를 사용하여 API를 실험할 수 있습니다.
Google 계정 만들기
애플리케이션에서 Google Cloud API를 사용하려면 먼저 Google 계정이 있어야 합니다. 이렇게 하면 Google Cloud 콘솔, gcloud CLI, Cloud Logging, Cloud Monitoring을 포함하여 Google 개발자 제품을 사용할 수 있습니다. Google Cloud를 처음 사용하는 경우 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
Google 프로젝트 만들기
Cloud API를 사용하려면 Google 프로젝트도 있어야 합니다. 프로젝트는 개발자 계정과 같습니다. 프로젝트는 Google Cloud 리소스에 대한 리소스 컨테이너 역할을 수행합니다. 또한 Google Cloud 서비스 사용에 대한 격리 경계를 제공하므로 프로젝트 수준에서 할당량 한도 및 결제를 직접 관리할 수 있습니다. 사용 원격 분석 및 대시보드는 프로젝트별로도 그룹화됩니다. 아직 프로젝트가 없으면 Google Cloud Console을 사용하여 프로젝트를 만들 수 있습니다.
프로젝트는 API 키, OAuth 클라이언트, 서비스 계정, Compute Engine VM, Cloud Storage 버킷, BigQuery 데이터 세트를 비롯한 다양한 리소스를 소유할 수 있습니다. 애플리케이션이 Cloud APIs를 호출하면 애플리케이션 사용자 인증 정보를 소유한 프로젝트를 클라이언트 프로젝트라고 하고 대상 리소스를 소유한 프로젝트를 리소스 프로젝트라고 합니다. API 요청 하나가 여러 리소스를 사용할 수 있으므로 여러 리소스 프로젝트가 관련됩니다.
어떤 이유로든 Google Cloud 사용을 중지하려면 Google Cloud Console을 사용하여 프로젝트를 삭제하면 됩니다. 보관 기간이 지나면 프로젝트와 프로젝트의 모든 리소스가 삭제됩니다. 다른 유형의 데이터에는 다른 보관 기간이 있습니다.
API 검색
Cloud API를 사용하기 전 Google Cloud Console API 라이브러리를 사용하여 사용 가능한 Cloud API를 찾아보고 비즈니스 요구에 가장 부합되는 항목을 찾아야 합니다. 특정 Cloud API에 대한 자세한 내용은 Spanner API와 같은 공개 문서 사이트를 방문하세요.
API 사용 설정
일부 Cloud API는 기본적으로 사용 설정됩니다. 기본적으로 사용 설정되지 않는 Cloud API를 사용하려면 프로젝트에 사용 설정해야 합니다. 클라이언트 프로젝트와 리소스 프로젝트를 포함한 애플리케이션과 관련된 서비스와 프로젝트에 따라 여러 프로젝트에서 API를 사용 설정해야 할 수 있습니다. 다른 API에 의존하는 API를 사용 설정하면 해당 API도 동시에 사용 설정됩니다.
API를 사용 설정하려면 API에 대한 서비스 약관 및 청구 책임에 동의해야 합니다. API를 사용 설정하려면 프로젝트에 대해 serviceusage.services.enable 권한이 필요합니다. 자세한 정보는 서비스 사용량 액세스 제어를 참조하세요.
또한 사용 설정할 서비스는 공개 상태여야 합니다. 아니면 서비스 소유자가 사용자에게 비공개 서비스에 대해 servicemanagement.services.bind 권한을 부여해야 합니다. 자세한 내용은 Service Management 액세스 제어를 참조하세요.
Cloud API를 사용하여 애플리케이션을 구축하는 경우, 가능하다면 Google Cloud 클라이언트 라이브러리를 사용하는 것이 좋습니다. 클라이언트 라이브러리는 인증, 오류 처리, 재시도, 페이로드 유효성 검사와 같은 편의를 위한 일반적인 API 기능을 처리합니다. 클라이언트 라이브러리가 애플리케이션 대신 Google Cloud API를 호출할 수 있도록 초기화 중에 애플리케이션 사용자 인증 정보를 클라이언트 라이브러리에 전달해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eThis guide outlines the steps for developers to begin using Google Cloud APIs, starting with experimenting using \u003ccode\u003ecurl\u003c/code\u003e commands.\u003c/p\u003e\n"],["\u003cp\u003eUtilizing Google Cloud APIs necessitates a Google account and a Google project, which serves as a resource container and isolation boundary.\u003c/p\u003e\n"],["\u003cp\u003eBefore using a Cloud API, one must discover it in the API Library and then enable it for the relevant project(s), which may involve accepting terms and billing responsibility.\u003c/p\u003e\n"],["\u003cp\u003eFor using certain APIs and building full applications, a billing account linked to the project and proper authentication credentials, such as Application Default Credentials or API keys, are required.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Cloud Client Libraries are recommended for building applications, as they simplify API interactions by managing authentication, error handling, retries, and payload validation.\u003c/p\u003e\n"]]],[],null,["# Getting started\n\nThis page explains how developers can get started using Google Cloud APIs.\n\nIf you are using Google Cloud APIs for the first time, you can follow\nthe steps in this guide to call the APIs using `curl` commands. You can use\n`curl` commands to experiment with an API before you develop your application.\n\nCreating a Google account\n-------------------------\n\nTo use Google Cloud APIs in your applications, you first need to have a\nGoogle account. This allows you to use Google developer products, including\n[Google Cloud console](https://console.cloud.google.com/),\n[gcloud CLI](/sdk), [Cloud Logging](/logging), and\n[Cloud Monitoring](/monitoring). If you're new to Google Cloud,\n[create an account](https://console.cloud.google.com/freetrial)\nto evaluate how our products perform in real-world scenarios. New customers\nalso get $300 in free credits to run, test, and deploy workloads.\n\nCreating a Google project\n-------------------------\n\nTo use Cloud APIs, you also need to have a Google project. A project is\nequivalent to a developer account. It serves as a resource container for\nyour Google Cloud resources. It also provides an isolation boundary for your\nusage of Google Cloud services, so you can manage quota limits and billing\nindependently at the project level. Usage telemetry and dashboards are grouped\nby projects as well. If you don't already have a project, you can create one\nusing the [Google Cloud console](https://console.cloud.google.com/).\n\nA project can own a wide range of resources, including API keys, OAuth clients,\nservice accounts, Compute Engine VMs, Cloud Storage buckets, and BigQuery\ndatasets. When an\napplication calls a Cloud API, the project that owns the application\ncredentials is called the *client project* , and the project that owns the\ntarget resource is called the *resource project*. One API request may touch\nmultiple resources, hence multiple resource projects are involved.\n\nIf you want to stop using Google Cloud for any reasons, you can use\n[Google Cloud console](https://console.cloud.google.com/) to delete your project. Your\nproject and all resources in the project will be deleted after the retention\nwindow. Note that different types of data have different retention periods.\n\nDiscovering APIs\n----------------\n\nBefore using any Cloud APIs, you should use Google Cloud console\n[API Library](https://console.cloud.google.com/apis/library/browse) to\nbrowse available Cloud APIs and discover the ones that best meet your business\nneeds. For more information about a specific Cloud API, visit its public\ndocumentation site, such as [Spanner API](/spanner).\n\nEnabling APIs\n-------------\n\nSome Cloud APIs are enabled by default. To use a Cloud API that is not enabled\nby default, you must enable it for your project. Depending on which\nservices and which projects are involved from your application, including the\nclient project and resource projects, you may need to enable an API for\nmultiple projects. When you enable an API that depends on other APIs, those APIs\nare also enabled at the same time.\n\nEnabling an API requires you to accept the Terms of Service and billing\nresponsibility for the API. You need permission `serviceusage.services.enable`\non the project to enable APIs. For more information, see Service Usage\n[Access Control](/service-usage/docs/access-control).\n\nIn addition, the service to enable must either be public, or else the service\nowner must grant the user the `servicemanagement.services.bind` permission on\nthe private service. See [Service Management Access Control](/service-infrastructure/docs/service-management/access-control) for more\ninformation.\n\nTo enable an API for a project using the console:\n\n1. Go to the [Google Cloud console API Library](https://console.cloud.google.com/apis/library?project=_).\n2. From the projects list, select the project you want to use.\n3. In the API Library, select the API you want to enable. If you need help finding the API, use the search field and/or the filters.\n4. On the API page, click **ENABLE**.\n\nFrom the same page you can disable an API for your project if you no longer\nuse it to avoid misuse and accidental billing charges. You can also enable\nand disable Cloud APIs using the [gcloud CLI](/sdk/docs) and the\n[Service Usage API](/service-usage/docs/reference/rest/v1/services/enable): \n\n $ gcloud services enable pubsub.googleapis.com\n $ gcloud services disable pubsub.googleapis.com\n\nEnabling billing\n----------------\n\nSome Cloud APIs charge for usage. You need to enable billing for your project\nbefore you can start using these APIs in your project. The API usage in a\nproject is charged to the billing account associated with the project.\n\nIf you don't have a billing account, go to the\n[Google Cloud console billing page](https://console.cloud.google.com/billing)\nand follow the instructions to create one. Then\n[link your billing account](https://console.cloud.google.com/billing/linkedaccount?project=_)\nto your project.\n\nAuthenticating to APIs\n----------------------\n\nHow you authenticate to an API depends on your development environment and what\nauthentication methods the API supports.\n\nSetting up [Application Default Credentials](/docs/authentication/provide-credentials-adc) for use in a variety of\nenvironments is the most common approach, and is recommended for most\napplications. If the API supports [API keys](/docs/authentication/api-keys), that is another option.\nIf your application needs to access Cloud resources owned by your end users, you\n[create an OAuth 2.0 Client ID and use the authentication libraries](https://developers.google.com/identity/protocols/oauth2/web-server).\n\nFor general information about authentication, see\n[Authentication at Google](/docs/authentication).\n\nBuilding applications\n---------------------\n\nIf you are building an application using Cloud APIs, we recommend you to use\n[Google Cloud Client Libraries](/apis/docs/cloud-client-libraries) if\navailable. The client libraries can handle common API features for your\nconvenience, such as authentication, error handling, retry, and payload\nvalidation. You need to pass your application credentials to the client\nlibraries during initialization, so the client libraries can make calls to\nGoogle Cloud APIs on behalf of your application.\n\nSee the following step-by-step guides that use the client libraries for some\npopular APIs:\n\n- [Cloud Billing Budget API with Node.js](https://console.cloud.google.com/?tutorial=billing--budget--billing-budget-api-nodejs).\n- [Cloud Billing Budget API with Python](https://console.cloud.google.com/?tutorial=billing--budget--billing-budget-api-python).\n- [Cloud Logging with Node.js](https://console.cloud.google.com/?tutorial=logging--logging-nodejs).\n- [Cloud Logging with Python](https://console.cloud.google.com/?tutorial=logging--logging-python).\n- [Cloud Logging with Go](https://console.cloud.google.com/?tutorial=logging--logging-go).\n- [Cloud Logging with Java](https://console.cloud.google.com/?tutorial=logging--logging-java).\n- [Speech-to-Text with Node.js](https://console.cloud.google.com/?tutorial=speech-to-text--speech-to-text-nodejs).\n- [Speech-to-Text with Python](https://console.cloud.google.com/?tutorial=speech-to-text--speech-to-text-python).\n- [Speech-to-Text with Go](https://console.cloud.google.com/?tutorial=speech-to-text--speech-to-text-go).\n- [Speech-to-Text with Java](https://console.cloud.google.com/?tutorial=speech-to-text__speech-to-text-java).\n\nFor more information, see\n[Client Libraries Explained](/apis/docs/client-libraries-explained).\n\nMore information\n----------------\n\n- For more information about authentication, see\n [Authentication at Google](/docs/authentication).\n\n- For more information about error handling, see\n [Handling Errors](/apis/design/errors#handling_errors).\n\n- For more information about billing, see\n [Create, modify, or close your billing account](/billing/docs/how-to/manage-billing-account).\n\n- For more information about enabling billing on your project, see\n [Modify a project's billing settings](/billing/docs/how-to/modify-project).\n\n- For more information about enabling and disabling APIs, see\n [Enabling and disabling services](/service-usage/docs/enable-disable)."]]