Skip to content

PageSpeedInsight missing 'key' parameter for using an API key. #2657

Open
@marinabrook

Description

@marinabrook

When i use the PageSpeedInsight api, mostly i get an error like:
Quota exceeded for quota metric 'Queries' and limit 'Queries per minute' of service 'pagespeedonline.googleapis.com' for consumer 'project_number:583797351490'."
So i need to pass either oauth 2.0 or an API key.
On my app, i need to pass an API key because i dont want to login first, since this feature(PageSpeedInsight) can be freely accessed.

Problem:
Then, my problem is there is no 'key' parameter on PageSpeedInsight class. so, i cant pass the key.
Solution:
I manage to fix this, by adding a 'key' parameter after 'utm_source' parameter like this:
\ existing code
'utm_source' => [
'location' => 'query',
'type' => 'string',
],
\ I add this one:
'key' => [
'location' => 'query',
'type' => 'string',
],

Reason:
I request this because i think its not good editing on vendor folder (I use laravel).
it would be better if google add this then update the documentation about request parameter of this API.
so i dont need to edit anyhing on my vendor folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions