Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request images containing colors #10

Open
ghost opened this issue May 7, 2019 · 4 comments
Open

request images containing colors #10

ghost opened this issue May 7, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented May 7, 2019

Hi, Is it possible to request all images containing certain colors (where the colors are given in hex code)? I tried with https://api.harvardartmuseums.org/color/34838386?apikey=...colors=color:#0000ff|#FF0000&q=imagepermissionlevel:0

but that didn't seem to work. Thank you.

@jeffsteward
Copy link
Contributor

Not exactly. The color endpoint isn't directly associated with images.

One way to approach this is to request all objects whose primary image contains certain colors. Use the color parameter on the object endpoint. Set the color parameter to a URL encoded hex color value. For example, the following query will find all objects with an image containing the color #afaf4b.

https://api.harvardartmuseums.org/object?apikey=[YOUR-API-KEY]&color=%23afaf4b

@ghost
Copy link
Author

ghost commented May 13, 2019

Thank you @jeffsteward That works perfectly

@TwentyPorts
Copy link

@jeffsteward Is there a way to search by a range of colors, or is it only possible to search by exact color hex codes?

@jeffsteward
Copy link
Contributor

@TwentyPorts At present the API only supports search by exact color hex codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants