Skip to content

API Issue: hasImages=true Returns Objects Without Images #57

@ZOUHAIRFGRA

Description

@ZOUHAIRFGRA

We encountered an issue with the hasImages=true query parameter when fetching objects from the Met Museum API. According to the documentation, this parameter should return only objects that have images. However, our query returned multiple objects without images (primaryImage and primaryImageSmall are empty).

Steps to Reproduce

  1. Perform a search with hasImages=true, for example:
    https://collectionapi.metmuseum.org/public/collection/v1/search?q=a&hasImages=true
    
  2. Fetch details of the objects returned by the search.
  3. Some objects have empty primaryImage and primaryImageSmall fields.

Example of Affected Objects

The following objects were returned in a hasImages=true search but lack images:

(There are more cases, but these are just 10 examples)

Expected Behavior

When querying with hasImages=true, only objects with valid images should be included in the search results.

Actual Behavior

The query returns objects with no images, even though hasImages=true is specified.

Suggested Fix

  • Ensure the hasImages=true filter only includes objects with valid images in primaryImage or primaryImageSmall.
  • Double-check database records to confirm why these objects are included.

Environment

  • API Version: Public Met API
  • Query Used: q=a&hasImages=true
  • Browser/Platform: Any browser or API client

Additional Notes

This issue affects UI and user experience, as we have to filter out invalid objects manually.

Metadata

Metadata

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