{"id":16605832,"url":"https://github.com/jedahan/collections-api","last_synced_at":"2025-03-21T14:30:46.625Z","repository":{"id":4087358,"uuid":"5193856","full_name":"jedahan/collections-api","owner":"jedahan","description":"API scraping from the metmuseum website","archived":false,"fork":false,"pushed_at":"2019-02-04T16:07:39.000Z","size":487,"stargazers_count":36,"open_issues_count":6,"forks_count":18,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-18T02:01:42.982Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://scrAPI.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jedahan.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-26T15:34:28.000Z","updated_at":"2022-10-19T16:59:08.000Z","dependencies_parsed_at":"2022-09-01T01:42:14.943Z","dependency_job_id":null,"html_url":"https://github.com/jedahan/collections-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fcollections-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fcollections-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fcollections-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fcollections-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedahan","download_url":"https://codeload.github.com/jedahan/collections-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244815076,"owners_count":20514879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T01:01:49.364Z","updated_at":"2025-03-21T14:30:46.339Z","avatar_url":"https://github.com/jedahan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠️ the museum api has changed a bunch, this needs a rewrite\n\n# scrapi, a metropolitan museum collections api\n\n[scrAPI.org](http://scrapi.org) is an api that grabs object information from the metropolitan museum's [collections](http://metmuseum.org/collection) website.\n\n### Get a random object (`/random`)\nTry `curl scrapi.org/random` in a terminal, or just click on [/random](random)\n```bash\n$ curl 'scrapi.org/random'\n{\n  \"CRDID\": 12351,\n  \"accessionNumber\": \"65.211.3\",\n  ...\n}\n```\n\n### Object information (`/object/:id`)\n\nTry `curl scrapi.org/object/123` in a terminal, or just click on [object/1234](object/123)\n```bash\n$ curl 'scrapi.org/object/123'\n{\n  \"CRDID\": 123,\n  \"accessionNumber\": \"64.291.2\",\n  ...\n}\n```\n\n### Searching for object ids (`/search/:terms`)\n\nYou can now search for terms, and get back an array of hrefs to object pages\n```bash\n$ curl 'scrapi.org/search/mirror'\n{\n  \"collection\": {\n    \"items\": [\n      {\n          \"href\": \"http://scrapi.org/object/156225\"\n      },\n      {\n          \"href\": \"http://scrapi.org/object/207785\"\n      },\n      ...\n      ]\n    }\n\n}\n```\n### additional Params in search:\n\n\u0026page=X - for additional pages\n\n\u0026gallerynos=X for only objects in that gallery\n\n### Filtering with the `fields` parameter\n\nIf you want to filter *any* response, use the `fields` parameter, like so:\n\n```bash\n$ curl 'scrapi.org/object/123?fields=title,whoList/who/name'\n{\n  \"whoList\": {\n    \"who\": {\n      \"name\": \"Richard Wittingham\"\n    }\n  },\n  \"title\": \"Andiron\"\n}\n```\n\nThe syntax to filter out fields is loosely based on XPath:\n\n- `a,b,c` comma-separated list will select multiple fields\n- `a/b/c` path will select a field from its parent\n- `a(b,c)` sub-selection will select many fields from a parent\n- `a/*/c` the star `*` wildcard will select all items in a field\n\nI like the following fields for basic object information: `fields=title,primaryArtistNameOnly,primaryImageUrl,medium,whatList/what/name,whenList/when/name,whereList/where/name,whoList/who/name`\n\n\n### Guidelines\n\nThe code is [CC0](https://creativecommons.org/publicdomain/zero/1.0/), but if you do anything interesting with the data, it would be nice to give attribution to The Metropolitan Museum of Art. If you do anything interesting with the code, it would be nice to give attribution to the contributors, or even better, become one!\n\nPlease submit all questions, bugs and feature requests to [the issue page](https://github.com/jedahan/collections-api/issues).\n\nDedicated to the memory of [Aaron Swartz](https://en.wikipedia.org/wiki/Aaron_Swartz).\n\n### Installation and Deployment\n\nThe API requires [node.js](https://nodejs.org/), uses [redis](http://redis.io/) for caching, and is built on the [koa](http://koajs.com/) web framework.\n\nIf you already have nodejs installed:\n\n    which yarn || npm install -g yarn\n    yarn\n    yarn start\n    open 127.0.0.1:8080 || xdg-open 127.0.0.1:8080\n\nIf you don't want to have to setup node, yarn, and redis on your local machine, I published a docker image:\n\n    which docker || { sudo apt-get install -y docker || cask install docker }\n    docker pull jedahan/collections-api\n    docker run -d -p 8080:8080 --name collections-api jedahan/collections-api\n    open 127.0.0.1:8080 || xdg-open 127.0.0.1:8080\n    curl localhost:8080/random\n\nYou can build the docker image yourself if you want:\n\n    which docker || { sudo apt-get install -y docker || cask install docker }\n    docker build -t jedahan/collections-api:latest .\n    docker run -d -p 8080:8080 --name collections-api jedahan/collections-api\n    open 127.0.0.1:8080 || xdg-open 127.0.0.1:8080\n    curl localhost:8080/random\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedahan%2Fcollections-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedahan%2Fcollections-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedahan%2Fcollections-api/lists"}