adobe / spacecat-api-service

Edge Delivery services experience success as a service automation: SpaceCat + Star Catalogue
Apache License 2.0
3 stars 3 forks source link

API for exposing top pages metrics for a specific site #461

Open iuliag opened 1 month ago

iuliag commented 1 month ago

Is your feature request related to a problem? Please describe. Implement API for exposing top pages metrics for a specific site

Describe the solution you'd like API endpoint for exposing top pages metrics for a specific site. Be able to get:

API spec proposed in https://github.com/adobe/spacecat-api-service/pull/292, https://opensource.adobe.com/spacecat-api-service/#tag/top-pages/operation/getSiteTopPages

Or we can align with the site metrics by source API https://opensource.adobe.com/spacecat-api-service/#tag/experimental/operation/getSiteMetricsBySource and have something along the lines of:

GET /sites/{siteId}/top-pages/metrics/{metric}/{source}
GET /sites/{siteId}/top-pages/metrics/organic-traffic
GET /sites/{siteId}/top-pages/metrics/organic-traffic/ahrefs
GET /sites/{siteId}/top-pages/metrics/organic-traffic/ahrefs/au

[
  {
    "siteId": "a1b2c3d4-e5f6-7g8h-9i0j-k11l12m13n14",
    "source": "ahrefs",
    "name": "organic-traffic",
    "value": 37900,
    "time": "2024-04-29T00:00:00.000Z"
    "geo": "au",
    "url": "https://example-site.com/foo/bar"
  }
]