Creating Community Lists
The purpose of this guide is helping librarians and individuals take a list of Open Library keys (e.g. /works/OL123W, /works/OL234W
) and populate a themed list in bulk.
The Open Library Official Book Lists Account
Open Library has an account specifically for featuring organization-vetted lists: https://openlibrary.org/people/booklists
An administrator may login to this account by going to: https://openlibrary.org/admin/people/booklists
Notes
- You must be logged in to Open Library in order to create or add to a list.
- These instructions should work for your personal account if you want to create a list in bulk.
Instructions
Create a list manually for at least one seed and give it a title and description.
The list should now exist and appear under the booklists account's lists page: e.g. https://openlibrary.org/people/booklists/lists/OL194558L/International_Women's_Day_Celebrate_Women_Authors
Open up your browser's developer javascript console by pressing "control + shift + i" (linux/windows) or right-click on page and select the "Inspect" option in the right-click menu. Navigate to the
console
tab which will let you submit code.If you know the Open Library IDs (olids) of works and editions in advance, you may use the following javascript incantation to add them in bulk to the list you created above.
Remove the human readable slug portion of the URL from step (3) -- in this example "/International_Women%27s_Day_Celebrate_Women_Authors" -- and add /seeds.json: e.g. https://openlibrary.org/people/booklists/lists/OL194558L/seeds.json
This url will be added into line 1 of the code below:
await fetch("https://openlibrary.org/people/booklists/lists/OL194558L/seeds.json", {
"credentials": "include",
"body": JSON.stringify({add: [
// IDs here
]}),
"method": "POST",
"mode": "cors"
});
Replace the // IDs here
with a list of IDs of the form {key: '/works/OL20008022W'}, ...
- A complete example should look like:
await fetch("https://openlibrary.org/people/booklists/lists/OL194558L/seeds.json", {
"credentials": "include",
"body": JSON.stringify({add: [
{key: '/works/OL20008022W'}, {key: '/works/OL5731542W'}, {key: '/works/OL19966826W'},
{key: '/works/OL8476068W'}, {key: '/works/OL2335989W'}, {key: '/works/OL21097322W'},
]}),
"method": "POST",
"mode": "cors"
});
There is a limit of how many keys you can include in each request submitting the above code, which I (@mekarpeles) believe is either 100 or 50. You can resubmit the code as many times as needed with different batches of keys.