Skip to content

Retail API API

by googleapis.com

OAuthHTTPSAnalytics
Open documentation ↗

Overview

Cloud Retail service enables customers to build end-to-end personalized recommendation systems without requiring a high level of expertise in machine learning, recommendation system, or Google Cloud.

Retail API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 42 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Analytics
Base URL
https://retail.googleapis.com/
Version
v2alpha
Endpoints
42
Spec updated
2023-04-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://retail.googleapis.com/v2alpha/CATALOG:completeQuery" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://retail.googleapis.com/v2alpha/CATALOG:completeQuery", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://retail.googleapis.com/v2alpha/CATALOG:completeQuery",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
POST/v2alpha/{attributesConfig}:addCatalogAttributeAdds the specified CatalogAttribute to the AttributesConfig. If the CatalogAttribute to add already exists, an ALREADY_EXISTS error is returned.
POST/v2alpha/{attributesConfig}:batchRemoveCatalogAttributesRemoves all specified CatalogAttributes from the AttributesConfig.
POST/v2alpha/{attributesConfig}:removeCatalogAttributeRemoves the specified CatalogAttribute from the AttributesConfig. If the CatalogAttribute to remove does not exist, a NOT_FOUND error is returned.
POST/v2alpha/{attributesConfig}:replaceCatalogAttributeReplaces the specified CatalogAttribute in the AttributesConfig by updating the catalog attribute with the same CatalogAttribute.key. If the CatalogAttribute to
GET/v2alpha/{catalog}:completeQueryCompletes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud
GET/v2alpha/{catalog}:getDefaultBranchGet which branch is currently default branch set by CatalogService.SetDefaultBranch method under a specified parent catalog.
POST/v2alpha/{catalog}:setDefaultBranchSet a specified branch id as default branch. API methods such as SearchService.Search, ProductService.GetProduct, ProductService.ListProducts will treat request
GET/v2alpha/{name}Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
POST/v2alpha/{name}Creates a MerchantCenterAccountLink. MerchantCenterAccountLink cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned.
PATCH/v2alpha/{name}Updates a ServingConfig.
DELETE/v2alpha/{name}Deletes a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.
GET/v2alpha/{name}/operationsLists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
POST/v2alpha/{name}:pausePauses the training of an existing model.
POST/v2alpha/{name}:resumeResumes the training of an existing model.
POST/v2alpha/{name}:setInventoryUpdates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not requi
POST/v2alpha/{name}:tuneTunes an existing model.
GET/v2alpha/{parent}/catalogsLists all the Catalogs associated with the project.
POST/v2alpha/{parent}/completionData:importBulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only
GET/v2alpha/{parent}/controlsLists all Controls by their parent Catalog.
POST/v2alpha/{parent}/controlsCreates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned.
GET/v2alpha/{parent}/merchantCenterAccountLinksLists all MerchantCenterAccountLinks under the specified parent Catalog.
GET/v2alpha/{parent}/modelsLists all the models linked to this event store.
POST/v2alpha/{parent}/modelsCreates a new model.
GET/v2alpha/{parent}/productsGets a list of Products.
POST/v2alpha/{parent}/productsCreates a Product.
POST/v2alpha/{parent}/products:importBulk import of multiple Products. Request processing may be synchronous. Non-existing items are created. Note that it is possible for a subset of the Products t
POST/v2alpha/{parent}/products:purgePermanently deletes all selected Products under a branch. This process is asynchronous. If the request is valid, the removal will be enqueued and processed offl
GET/v2alpha/{parent}/servingConfigsLists all ServingConfigs linked to this catalog.
POST/v2alpha/{parent}/servingConfigsCreates a ServingConfig. A maximum of 100 ServingConfigs are allowed in a Catalog, otherwise a FAILED_PRECONDITION error is returned.
GET/v2alpha/{parent}/userEvents:collectWrites a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only b
POST/v2alpha/{parent}/userEvents:importBulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user even
POST/v2alpha/{parent}/userEvents:purgeDeletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours
POST/v2alpha/{parent}/userEvents:rejoinStarts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from
POST/v2alpha/{parent}/userEvents:writeWrites a single user event.
POST/v2alpha/{placement}:predictMakes a recommendation prediction.
POST/v2alpha/{placement}:searchPerforms a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.
POST/v2alpha/{product}:addFulfillmentPlacesIt is recommended to use the ProductService.AddLocalInventories method instead of ProductService.AddFulfillmentPlaces. ProductService.AddLocalInventories achiev
POST/v2alpha/{product}:addLocalInventoriesUpdates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asyn
POST/v2alpha/{product}:removeFulfillmentPlacesIt is recommended to use the ProductService.RemoveLocalInventories method instead of ProductService.RemoveFulfillmentPlaces. ProductService.RemoveLocalInventori
POST/v2alpha/{product}:removeLocalInventoriesRemove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal
POST/v2alpha/{servingConfig}:addControlEnables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec con
POST/v2alpha/{servingConfig}:removeControlDisables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for th

Questions

Does the Retail API API need an API key?

Yes. The Retail API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Retail API API support HTTPS?

Yes, the Retail API API is served over HTTPS.

How many endpoints does the Retail API API have?

Its OpenAPI description lists 42 endpoints in version v2alpha. All of them are shown on this page.

What are alternatives to the Retail API API?

Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.

Compare alternatives →

Google Play Integrity API

Analytics

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

OAuth1 endpoints

versionhistory.googleapis.com API

Analytics

Version History API - Prod

No auth4 endpoints

Doc Converter

Analytics

This api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)

No auth1 endpoints

Perspective Comment Analyzer API

Analytics

The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.

OAuth2 endpoints

Safe Browsing API

Analytics

Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.

No auth7 endpoints

Web Fonts Developer API

Analytics

The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.

No auth1 endpoints

Listed from APIs.guru (CC0).