Arunabh05
Arunabh05

Reputation: 53

Is it possible to create google API KEY programmatically?

I'm trying to automate the process of creating and managing my projects on Google Cloud Platform. I want to create new project and generate API keys for it and use them.

I am unable to find any API to create API KEYS. Is there any solution ?

Thanks

Upvotes: 5

Views: 3070

Answers (3)

8c6b5df0d16ade6c
8c6b5df0d16ade6c

Reputation: 2524

❯ gcloud alpha services api-keys create --display-name=NAME

See: https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/create

Upvotes: 2

hubatish
hubatish

Reputation: 5220

You may not be able to create API keys programmatically, but you can create service accounts. Service accounts can do all the things on API keys can, and are much more secure than API keys. And you can create them via API calls!

Here's the API reference for creating service accounts, and for creating service account keys (which have a public/private keypair).

Here's the API reference for creating projects.

You should be able to do whatever you were trying to accomplish with these tools. But for most simple use-cases using the UI is recommended.

Upvotes: 4

From My little experience you can't . You have to use Google API Console

Upvotes: 0

Related Questions