Skip to content

Add an endpoint for showing the usages and supplier of image ids - #4871

Draft
lindseydew wants to merge 2 commits into
mainfrom
ld/quotas-endpoint
Draft

Add an endpoint for showing the usages and supplier of image ids#4871
lindseydew wants to merge 2 commits into
mainfrom
ld/quotas-endpoint

Conversation

@lindseydew

@lindseydew lindseydew commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What does this change?

This adds a bespoke endpoint that uses the same query params as the search API, but returns only an image id, supplier and usages to make it easier to reconcile how many images have been used as part of the quota.

The params to use the test the output are:

https://api.media.local.dev-gutools.co.uk/images-usages?q=usages@%3Eadded:2026-07-01%20usages@%3Cadded:2026-07-31%20usages@status:published&nonFree=true

A specific supplier can optionally be added:

https://api.media.local.dev-gutools.co.uk/images-usages?q=usages@%3Eadded:2026-07-01%20usages@%3Cadded:2026-07-31%20usages@status:published%20supplier:AAP&nonFree=true

This also changes the way pagination is implemented as the existing logic did not seem to be working from what I could see 🤔
At the moment this updates the search endpoint too, though I think it would be better to scope any changes to just this endpoint before releasing

It might be a bit of annoying user experience to have to paginate manually. A good next step could be to implement a recursive search to get all the ids and then produce a .csv file to download.

How should a reviewer test this change?

How can success be measured?

Who should look at this?

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

@lindseydew lindseydew added the feature Departmental tracking: work on a new feature label Aug 13, 2026
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant