Class v1beta.ReportServiceClient (0.9.0) Stay organized with collections Save and categorize content based on your preferences.
Service for retrieving reports and insights about your products, their performance, and their competitive environment on Google. v1beta
Package
@google-shopping/reportsConstructors
(constructor)(opts, gaxInstance)
constructor(opts?:ClientOptions,gaxInstance?:typeofgax|typeofgax.fallback);Construct an instance of ReportServiceClient.
| Parameters | |
|---|---|
| Name | Description |
opts | ClientOptions |
gaxInstance | typeofgax | typeoffallback: loaded instance of |
Properties
apiEndpoint
getapiEndpoint():string;The DNS address for this API service.
apiEndpoint
staticgetapiEndpoint():string;The DNS address for this API service - same as servicePath.
auth
auth:gax.GoogleAuth;descriptors
descriptors:Descriptors;innerApiCalls
innerApiCalls:{[name:string]:Function;};port
staticgetport():number;The port for this API service.
reportServiceStub
reportServiceStub?:Promise<{[name:string]:Function;}>;scopes
staticgetscopes():string[];The scopes needed to make gRPC calls for every method defined in this service.
servicePath
staticgetservicePath():string;The DNS address for this API service.
universeDomain
getuniverseDomain():string;warn
warn:(code:string,message:string,warnType?:string)=>void;Methods
close()
close():Promise<void>;Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
| Returns | |
|---|---|
| Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
getProjectId()
getProjectId():Promise<string>;| Returns | |
|---|---|
| Type | Description |
Promise<string> | |
getProjectId(callback)
getProjectId(callback:Callback<string,undefined,undefined>):void;| Parameter | |
|---|---|
| Name | Description |
callback | Callback<string, undefined, undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
initialize()
initialize():Promise<{[name:string]:Function;}>;Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
| Returns | |
|---|---|
| Type | Description |
Promise<{ [name: string]:Function; }> | {Promise} A promise that resolves to an authenticated service stub. |
search(request, options)
search(request?:protos.google.shopping.merchant.reports.v1beta.ISearchRequest,options?:CallOptions):Promise<[protos.google.shopping.merchant.reports.v1beta.IReportRow[],protos.google.shopping.merchant.reports.v1beta.ISearchRequest|null,protos.google.shopping.merchant.reports.v1beta.ISearchResponse]>;Retrieves a report defined by a search query. The response might contain fewer rows than specified bypage_size. Rely onnext_page_token to determine if there are more rows to be requested.
| Parameters | |
|---|---|
| Name | Description |
request | ISearchRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.shopping.merchant.reports.v1beta.IReportRow[],protos.google.shopping.merchant.reports.v1beta.ISearchRequest | null,protos.google.shopping.merchant.reports.v1beta.ISearchResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array ofReportRow. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
search(request, options, callback)
search(request:protos.google.shopping.merchant.reports.v1beta.ISearchRequest,options:CallOptions,callback:PaginationCallback<protos.google.shopping.merchant.reports.v1beta.ISearchRequest,protos.google.shopping.merchant.reports.v1beta.ISearchResponse|null|undefined,protos.google.shopping.merchant.reports.v1beta.IReportRow>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISearchRequest |
options | CallOptions |
callback | PaginationCallback<protos.google.shopping.merchant.reports.v1beta.ISearchRequest,protos.google.shopping.merchant.reports.v1beta.ISearchResponse | null | undefined,protos.google.shopping.merchant.reports.v1beta.IReportRow> |
| Returns | |
|---|---|
| Type | Description |
void | |
search(request, callback)
search(request:protos.google.shopping.merchant.reports.v1beta.ISearchRequest,callback:PaginationCallback<protos.google.shopping.merchant.reports.v1beta.ISearchRequest,protos.google.shopping.merchant.reports.v1beta.ISearchResponse|null|undefined,protos.google.shopping.merchant.reports.v1beta.IReportRow>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISearchRequest |
callback | PaginationCallback<protos.google.shopping.merchant.reports.v1beta.ISearchRequest,protos.google.shopping.merchant.reports.v1beta.ISearchResponse | null | undefined,protos.google.shopping.merchant.reports.v1beta.IReportRow> |
| Returns | |
|---|---|
| Type | Description |
void | |
searchAsync(request, options)
searchAsync(request?:protos.google.shopping.merchant.reports.v1beta.ISearchRequest,options?:CallOptions):AsyncIterable<protos.google.shopping.merchant.reports.v1beta.IReportRow>;Equivalent tosearch, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request | ISearchRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.shopping.merchant.reports.v1beta.IReportRow> | {Object} An iterable Object that allowsasync iteration. When you iterate the returned iterable, each element will be an object representingReportRow. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see thedocumentation for more details and examples. |
/** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. *//** * Required. Id of the account making the call. Must be a standalone account * or an MCA subaccount. Format: accounts/{account} */// const parent = 'abc123'/** * Required. Query that defines a report to be retrieved. * For details on how to construct your query, see the Query Language * guide. For the full list of available tables and fields, see the Available * fields. */// const query = 'abc123'/** * Optional. Number of `ReportRows` to retrieve in a single page. Defaults to * the maximum of 1000. Values above 1000 are coerced to 1000. */// const pageSize = 1234/** * Optional. Token of the page to retrieve. If not specified, the first page * of results is returned. In order to request the next page of results, the * value obtained from `next_page_token` in the previous response should be * used. */// const pageToken = 'abc123'// Imports the Reports libraryconst{ReportServiceClient}=require('@google-shopping/reports').v1beta;// Instantiates a clientconstreportsClient=newReportServiceClient();asyncfunctioncallSearch(){// Construct requestconstrequest={parent,query,};// Run requestconstiterable=awaitreportsClient.searchAsync(request);forawait(constresponseofiterable){console.log(response);}}callSearch();searchStream(request, options)
searchStream(request?:protos.google.shopping.merchant.reports.v1beta.ISearchRequest,options?:CallOptions):Transform;Equivalent tosearch, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request | ISearchRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Transform | {Stream} An object stream which emits an object representingReportRow on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.