See the Google Cloud Platform (GCP) API authentication guide for more information about how to authenticate your clients to access GCP APIs.
A service account is a Google account that is associated with your GCP project. Use a service account to access the BigQuery API if your application can run jobs associated with service credentials rather than an end-user's credentials, such as a batch processing pipeline.
Use user credentials to ensure that your application has access only to BigQuery tables that are available to the end user. A user credential can run queries against only the end user's Cloud Platform project rather than the application's project, meaning the user is billed for queries instead of the application.
Authorizing API requests
Once you have authenticated your client, you must pass an access token to the BigQuery API so that it knows your client is authorized to access the requested resources. If you use the BigQuery client libraries, this is done for you automatically.
- If you are not using the client libraries, learn how to use access tokens in the authorization guide.