HTTPArchive / tech-report-apis

APIs for the HTTP Archive Technology Report
Apache License 2.0
2 stars 0 forks source link

Page weight formatting #13

Closed sarahfossheim closed 7 months ago

sarahfossheim commented 8 months ago

@maceto could you format the data the same as the other endpoints?

Current behavior

Currently it returns the data the same as in the JSON files:

[{
  "date": "2023-07-01",
  "technology": "WordPress",
  "rank": "ALL",
  "geo": "ALL",
  "client": "desktop",
  "median_bytes_total": "2600099",
  "median_bytes_js": "652651",
  "median_bytes_image": "1048110"
}]

Desired behavior

Something similar to the other endpoints, see for example: https://github.com/HTTPArchive/tech-report-apis/issues/4

Example format:

[{
  "date": "2023-07-01",
  "technology": "WordPress",
  "rank": "ALL",
  "geo": "ALL",
  "pageWeight": [{ // Or "page-weight"
    "name": "total", // Total, JS, Image
    "mobile": {
        "median_bytes": 1234
    },
    "desktop": {
        "median_bytes": 567
    },
  }]
}]
maceto commented 8 months ago

Hello @sarahfossheim

I will work on this with @rviscomi I think the BQ query is not returning the correct data.

Thank you

rviscomi commented 7 months ago

Updated the query in https://github.com/HTTPArchive/tech-report-apis/issues/10#issuecomment-1780340315 to return the expected format