Requesting a list of entities and filtering on IDs using OR syntax

92 views
Skip to first unread message

Marijane White

unread,
Jun 27, 2022, 4:17:16 PM6/27/22
to openale...@googlegroups.com

Hello,

 

I have a large list of PubMed IDs that I need to map to MAG IDs, and I’ve successfully figured out how to use the OpenAlex single entity work API to do this.  However, I’m dealing with lists of PMIDs that number in the tens of thousands, and the code takes hours to complete.  I was excited and hopeful when the recent API update added the OR syntax, but now that I have updated my code to use it, I’m running into a serious problem: The API tells me pmid is not a valid field.

 

Here’s an example:

https://api.openalex.org/works?filter=pmid:34791467|34791464|34789173|34784882|34784630|34783495|34780110|34780088|34768119|34763399|34762861|34761647|34761376|34761374|34758499|34757866|34756294|34755504|34755390|34753431|34751613|34747067|34743337|34738378|34738377|34729844|34729740|34726817|34726265|34724266|34723699|34716772|34715084|34713432|34705390|34703192|34702501|34697569|34697416|34695240|34689704|34684073|34676573|34674844|34674002|34673647|34671994|34671992|34670306|34669758

 

Am I really stuck making singleton calls?  Please say it isn’t so.

 

 

Marijane White, M.S.L.I.S.

Data and Research Engagement Librarian, Assistant Professor

Oregon Health & Science University Library

 

Email: whi...@ohsu.edu

ORCiD: https://orcid.org/0000-0001-5059-4132

 

Casey M

unread,
Jun 27, 2022, 9:12:05 PM6/27/22
to OpenAlex users
Hello! Casey here - one of the OpenAlex developers. We do not support this right now, but we are about to! 

By end of day this Thursday we plan to implement filters for the remaining IDs so that you can filter by PMID, PMCID, and MAG with OR filters. That is in addition to DOI and OpenAlex ID that are already supported within the IDs object.

I'll update this thread when it's done.

Casey

Marijane White

unread,
Jun 27, 2022, 9:44:46 PM6/27/22
to Casey M, OpenAlex users

Phew, this is great news! I’ve been procrastinating on updating my code for almost two months now, what uncanny timing. I eagerly await the update!

 

-Marijane

--
You received this message because you are subscribed to the Google Groups "OpenAlex users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openalex-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openalex-users/2a153205-d1bc-43cc-9546-a6c2023d0718n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Casey M

unread,
Jun 30, 2022, 12:53:29 PM6/30/22
to OpenAlex users
Hi Marijane,

This is implemented and available! You can now filter works by MAG, PMID, or PMCID. The new fields are listed in the docs here. As with other IDs, you can use the short-form such as 34669758 or the canonical form like https://pubmed.ncbi.nlm.nih.gov/34669758.

Thanks,
Casey

Marijane White

unread,
Jun 30, 2022, 2:47:04 PM6/30/22
to OpenAlex users

Excellent, thank you!

Reply all
Reply to author
Forward
0 new messages