Random institution of a given country

39 views
Skip to first unread message

Filippo Gianburrasca

unread,
May 26, 2025, 7:33:36 AMMay 26
to OpenAlex Community
Is  there a way to get a random institution in a given country?

The API endpoint does not seem to have an option to specify the country

Gabor Schubert

unread,
May 27, 2025, 3:07:33 AMMay 27
to OpenAlex Community
Hi,

I think you can use the sample function for this purpose: https://docs.openalex.org/how-to-use-the-api/get-lists-of-entities/sample-entity-lists
For example this command gives a random Swedish institution: https://api.openalex.org/institutions?sample=1&filter=country_code:SE

Best regards,
Gabor Schubert
Stockholm University

Dufois

unread,
May 27, 2025, 3:56:26 AMMay 27
to openalex-...@googlegroups.com

Hello,

thank you for your answers.

What is the difference between "sample" and "random" (https://docs.openalex.org/how-to-use-the-api/get-single-entities/random-result)?

What are the use cases in which we should prefer "random" over "sample"?

--
You received this message because you are subscribed to a topic in the Google Groups "OpenAlex Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openalex-community/BmHQPiviRn8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openalex-commun...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/openalex-community/98e566b4-cd81-4b4d-9cb0-04a39fe192aen%40googlegroups.com.

Gabor Schubert

unread,
May 27, 2025, 4:12:02 AMMay 27
to OpenAlex Community
As far as I see the main difference is that with random  (which is a function for single entities) you can get one result , but with sample (which is a function for lists of entities) you can get up to 10000 results 
Gabor

Reply all
Reply to author
Forward
0 new messages