I'm trying to use PageSpeed Insights API. The API Reference indicates that I can pass multiple category values when calling the API.
I issued the below command. Category values are separated with commas.
curl 'https://pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed?key=<my key>&url=<my url>&category=ACCESSIBILITY,BEST_PRACTICES,PERFORMANCE,PWA,SEO'
The API responds with the below JSON.
{
  "error": {
    "code": 400,
    "message": "Invalid value at 'category' (TYPE_ENUM), \"ACCESSIBILITY,BEST_PRACTICES,PERFORMANCE,PWA,SEO\"",
    "errors": [
      {
        "message": "Invalid value at 'category' (TYPE_ENUM), \"ACCESSIBILITY,BEST_PRACTICES,PERFORMANCE,PWA,SEO\"",
        "reason": "invalid"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}
I have no idea how I can pass multiple category values. Does anyone know how to do that?
Pass as seperate parameter rather than comma seperated.
curl 'https://pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed?key=<my key>&url=<my url>&category=ACCESSIBILITY&category=BEST_PRACTICES&category=PERFORMANCE&category=PWA&category=SEO'
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With