Making WordPress.org

Opened 2 months ago

Last modified 2 months ago

#8049 reopened defect (bug)

api.wordpress.org: page accessed in request differs to response

Reported by: yenedemet's profile yenedemet Owned by:
Milestone: Priority: normal
Component: API Keywords:
Cc:

Description

When submitting a request to api.wordpress.org with the page set to 1000, the returned response in the below image shows plugins from page 999. This also happens when the page is set to a value above 1000. Why does the request page value differ to the response?

https://i.postimg.cc/W4VhSgbt/Screenshot-2025-08-05-121330.png

Change History (3)

#1 follow-up: @dd32
2 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

The API has a maximum pagination of 999, requesting >999 will return the highest page possible.

The pagination maximums vary depending on the client/api/etc.

Ideally it would return an error, but I believe it was easier to just limit the pagination to resolve the abusive behaviour of certain clients.

#2 in reply to: ↑ 1 ; follow-up: @yenedemet
2 months ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Replying to dd32:

The API has a maximum pagination of 999, requesting >999 will return the highest page possible.

The pagination maximums vary depending on the client/api/etc.

Ideally it would return an error, but I believe it was easier to just limit the pagination to resolve the abusive behaviour of certain clients.

With 10 results per page set in the request, this would mean that a total of 9990 plugins can be retrieved from the API since the maximum pagination is 999.

https://wordpress.org/plugins/ mentions that there are over 59,000 free plugins. Does this mean that the API only returns a sub-section of plugin results?

#3 in reply to: ↑ 2 @dd32
2 months ago

Replying to yenedemet:

With 10 results per page set in the request

You can change the number of plugins returned using the posts_per_page parameter, up to a maximum of 250.

The source-code of the Query plugins endpoint is available here:
https://github.com/WordPress/wordpress.org/blob/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-query-plugins.php#L56-L67

The API in question is provided purely for the use of WordPress, 3rd-party clients are "unsupported" but not blocked, no "official" documentation of the endpoint exists other than that for the plugins_api() function in core: https://developer.wordpress.org/reference/functions/plugins_api/ there's community-provided documentation in the deprecated wiki: https://codex.wordpress.org/WordPress.org_API

Note: See TracTickets for help on using tickets.