Get userID from username
I'm writing some code that pulls items from a user's library. In time, it may grow authentication to work with private libraries, but for now, I'll settle for working with public libraries.
For a user visiting with a browser, my library is accessible just using my username:
https://www.zotero.org/takowl/items
However, for the API, I need to use my numeric userID, found in my settings. For now, I'm asking users to copy this in manually from their settings, but this is not a very nice experience. Is there a programmatic way to get a userID from a username, without dealing with oauth?
For a user visiting with a browser, my library is accessible just using my username:
https://www.zotero.org/takowl/items
However, for the API, I need to use my numeric userID, found in my settings. For now, I'm asking users to copy this in manually from their settings, but this is not a very nice experience. Is there a programmatic way to get a userID from a username, without dealing with oauth?
Zotero.userID
If you want an API way to send a username and get the userID without OAuth, I don't believe that exists.
Just go to
https://www.zotero.org/<username>/items
and you'd be able to scrape the userID from the page.