Migrate data sources management

Data sources let you upload your products to Google. Automated data sources make it easier to send your product data to Google. For more information, see Overview of Merchant Data sources API.

Here's a sample comparison of the requests in Content API for Shopping to the Merchant Data sources API:

Content API for Shopping Merchant Data sources API
URL https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds https://merchantapi.googleapis.com/datasources/v1beta/{parent}/dataSources
Identifiers {id} {name}

Methods

Here's a comparison of the data feeds methods in the Content API for Shopping and the Merchant Data sources API:

Method Content API for Shopping Merchant Data sources API
customBatch Yes No
insert Yes Yes
get Yes Yes
update Yes Yes
delete Yes Yes
list Yes Yes
fetchNow Yes Yes

Identifiers

Contrary to other resources, the name of the data source cannot be constructed from the Content API ID as the ID values have changed. You can call the list method to get the new IDs of the Data Sources.

Alternatively, you can call the accounts.products.get method and get the new Data Source ID from the product resource.

Methods

Here's what has changed for data feeds in the Merchant Data sources API:

Method URL in Content API for Shopping URL in Merchant Data sources API Identifier in Content API for Shopping Identifier in Merchant Data sources API Description
create POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds POST https://merchantapi.googleapis.com/datasources/v1beta/{parent=accounts/*}/dataSources {merchantId} {parent} In Content API for Shopping, the only create scenario is the create primary file feed. All other create scenarios have been newly introduced in Merchant Data sources API.
update PUT https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds/{datafeedId} PATCH https://merchantapi.googleapis.com/datasources/v1beta/{dataSource.name=accounts/*/dataSources/*} {merchantId}/datafeeds/{datafeedId} {dataSource.name=accounts/*/dataSources/*}
delete DELETE https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds/{datafeedId} DELETE https://merchantapi.googleapis.com/datasources/v1beta/{name=accounts/*/dataSources/*} {merchantId}/datafeeds/{datafeedId} {name=accounts/*/dataSources/*}
get GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds/{datafeedId} GET https://merchantapi.googleapis.com/datasources/v1beta/{name=accounts/*/dataSources/*} {merchantId}/datafeeds/{datafeedId} {name=accounts/*/dataSources/*}
list GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds GET https://merchantapi.googleapis.com/datasources/v1beta/{parent=accounts/*}/dataSources {merchantId} {parent}
fetchnow POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds/{datafeedId}/fetchNow POST https://merchantapi.googleapis.com/datasources/v1beta/{name=accounts/*/dataSources/*}:fetch {merchantId}/datafeeds/{datafeedId} {name=accounts/*/dataSources/*}
datafeedstatuses.get GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeedstatuses/{datafeedId} GET https://merchantapi.googleapis.com/accounts/v1beta/{merchantId}/datasources/{datafeedId}/fileUploads/latest {merchantId}/datafeeds/{datafeedId} {merchantId}/datasources/{datafeedId}

The identifier in the API request for retrieving product status is the same for both Content API for Shopping and Merchant API.

You can replicate the behavior of the datafeedstatuses.list request by gathering the data source IDs and calling fileUploads.get method for those IDs.