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

404 on some objectIds #47

Open
IslandRhythms opened this issue Mar 11, 2024 · 2 comments
Open

404 on some objectIds #47

IslandRhythms opened this issue Mar 11, 2024 · 2 comments

Comments

@IslandRhythms
Copy link

IslandRhythms commented Mar 11, 2024

await axios.get(`https://collectionapi.metmuseum.org/public/collection/v1/objects/181640`).then(res => res.data).catch(e => console.log('what is e', e.message, e.request.path));
what is e Request failed with status code 404 /public/collection/v1/objects/181640

Edit: I'm looking at the objectIds array and am seeing how there are missing objectids intentionally. What's the point of the total property if you can just use the .length property on the objectIds array?

@DaxServer
Copy link

@IslandRhythms It seems the ObjectID does not exist in the collection https://www.metmuseum.org/art/collection/search/181640 It does not exist in the latest CSV as well nor does in the API https://collectionapi.metmuseum.org/public/collection/v1/objects Thus you'd get the 404 error. How did you get that ID?

@IslandRhythms
Copy link
Author

I was doing random number generation as follows: Math.floor(Math.random() * res.total) + 1) To get a random object id to pull from the api but I see now that's the reason why you provide an array with all the objectids so someone can pull a value from the array of objectids instead.

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