Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Puedes especificar el orden de las filas en tu respuesta con la cláusula ORDER BY, que consta de una o más secuencias separadas por comas de lo siguiente:
FieldName('ASC'|'DESC')?
Si no especificas ASC o DESC después de un nombre de campo, la API de Reporting usará ASC de forma predeterminada.
La siguiente cláusula ORDER BY ordena un informe de rendimiento por impresiones en orden descendente y por IDs de ofertas de productos en orden ascendente:
ORDER BY no se permite en las métricas ni en los segmentos no seleccionados.
Limitar la cantidad de resultados
Puedes limitar la cantidad total de resultados que se muestran con la cláusula LIMIT.
Si combinas esto con el ordenamiento de los resultados, puedes generar informes de "los N principales", como un informe que contenga los cinco productos con la mayor cantidad de impresiones en los últimos 30 días:
[null,null,["Última actualización: 2025-08-13 (UTC)"],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and represents the future of product data integration.\u003c/p\u003e\n"],["\u003cp\u003eYou can order results with the \u003ccode\u003eORDER BY\u003c/code\u003e clause using fields and \u003ccode\u003eASC\u003c/code\u003e or \u003ccode\u003eDESC\u003c/code\u003e for ascending or descending order respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLIMIT\u003c/code\u003e clause enables you to specify the maximum number of returned results and can be combined with \u003ccode\u003eORDER BY\u003c/code\u003e to generate "top N" reports.\u003c/p\u003e\n"],["\u003cp\u003eWhile a query's maximum result limit is 1000 rows, pagination with \u003ccode\u003epageToken\u003c/code\u003e is necessary for retrieving additional results beyond this limit.\u003c/p\u003e\n"],["\u003cp\u003eFiltering using the \u003ccode\u003eWHERE\u003c/code\u003e clause on metrics necessitates their selection in the query.\u003c/p\u003e\n"]]],["The Merchant API beta, a new version of the Content API for Shopping, is introduced. You can order response rows using the `ORDER BY` clause with `ASC` or `DESC` order for selected fields. The `LIMIT` clause restricts the total results, enabling \"top N\" reports. `ORDER BY` is limited to selected fields, and filtering (`WHERE`) is not available for metrics that aren't selected. The maximum number of rows returned is 1000, requiring pagination for more results.\n"],null,["# Order and limit results\n\nYou can specify the order of rows in your response using the `ORDER BY` clause,\nwhich consists of one or more comma-separated sequences of: \n\n FieldName ('ASC' | 'DESC')?\n\nIf you don't specify `ASC` or `DESC` after a field name, the Reporting API\ndefaults to `ASC`.\n\nThe following `ORDER BY` clause sorts a performance report by descending\nimpressions and ascending product offer IDs: \n\n ORDER BY metrics.impressions DESC, segments.offer_id ASC\n\n`ORDER BY` is not allowed on non-selected metrics or non-selected segments.\n\nLimit the number of results\n---------------------------\n\nYou can limit the total number of results returned using the `LIMIT` clause.\nCombining this with results ordering, you can produce \"top N\" reports, such as a\nreport containing the five products with the highest impressions over the last\n30 days:\n\n#### Example\n\n SELECT\n segments.offer_id,\n metrics.impressions\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-12-01' AND '2020-12-31'\n ORDER BY metrics.impressions DESC\n LIMIT 5;\n\n| **Note:** The maximimum number of rows you can retrieve from a query is 1000, even if your limit is higher. You have to issue consecutive requests with the `pageToken` for the remaining results. To learn more, see our pagination guide.\n\nFiltering (`WHERE` clause) is not allowed on **metrics** without selecting them."]]