Plan for API latency

Latency is the time until you receive the response to a request. This guide gives order-of-magnitude latencies for Merchant API requests. Use these values to set timeouts and to plan the throughput of your integration.

Most Merchant API requests complete in less than a second. Local and regional inventory updates might take a few seconds, and some report queries take much longer.

Typical latencies

The following table lists approximate latencies by type of request. Typical latency is the median: half of the requests complete faster. The slowest 1% of requests take as long as the last column shows, or longer.

Type of request Example methods Typical latency Slowest 1% of requests
Product reads and writes products.get, productInputs.insert, productInputs.patch, productInputs.delete 100 to 600 milliseconds About 2 seconds
Most other requests products.list, accounts.get, dataSources.list, aggregateProductStatuses.list Less than 1 second A few seconds
Local and regional inventory writes localInventories.insert, regionalInventories.insert, and the corresponding delete methods A few seconds 10 seconds or more
Report queries accounts.reports.search About half a second 30 seconds or more

Report queries vary the most. Their latency depends on the report table that you query and on the amount of data that the query covers. About 1 in 10 report queries typically takes longer than 2 seconds, and a small fraction can take longer than a minute.

Recommendations

  • Set timeouts with headroom. If you set request timeouts in your client, set them well above the slowest latencies listed in Typical latencies. For example, a 60-second timeout leaves ample headroom for most requests, but not for all report queries.
  • Send independent requests in parallel. Because inventory writes take a few seconds each, sending them one after another limits your throughput. Send independent requests in parallel or use batch requests. When sending multiple requests, mind your per-minute and daily limits. For more information, see Rate quotas.
  • Limit report queries to the data that you need. Queries that cover large data sets, such as long date ranges, take longer and might time out. If you need large amounts of data, consider using BigQuery. For more information, see Load Google Merchant Center data into BigQuery.
  • Retry with exponential backoff. If a request times out or fails with a transient error, retry it with exponential backoff.

Processing time

For requests that change data, a successful response means that Merchant API accepted the change, but processing continues after the response. Processing time is the time from the response until the change is visible in other resources. Processing time isn't part of the latency, and it can be much longer. For example, it can take a few minutes until the processed product reflects an inserted product input.

For more information about the final processed state of your data, see the following guides: