({{, (RefLink[RandomEntity, paclet:ref/RandomEntity])[spec] 
gives a pseudorandom entity with a type determined by the specification spec.}, {, (RefLink[RandomEntity, paclet:ref/RandomEntity])[spec,n]
gives a list of n pseudorandom entities.}})

OpenersNotesSection(Spacer1)Details

(RefLink[RandomEntity, paclet:ref/RandomEntity]) returns (RefLink[Entity, paclet:ref/Entity]) objects.

The type specification in (RefLink[RandomEntity, paclet:ref/RandomEntity]) can be an (RefLink[EntityClass, paclet:ref/EntityClass]) object, an (RefLink[Entity, paclet:ref/Entity]) object, or an explicit entity type such as "Country", "Movie", "Person", etc.

(RefLink[RandomEntity, paclet:ref/RandomEntity]) will fetch sample entities from the online Wolfram Knowledgebase.

OpenersPrimaryExamplesSection(Spacer1)Examples  (6)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Get a sample of a "Country" entity:

RandomEntity["Country"]

Find a sample of 5 "Volcano" entities:

RandomEntity["Volcano",5]

OpenersExampleSection1(Spacer1)Scope  (2)

Samples can be given from (RefLink[EntityClass, paclet:ref/EntityClass]) expressions:

RandomEntity[(EntityClass["Ring of Fire", EntityClass["Volcano","RingOfFire"], "EntityClass[\"Volcano\", \"RingOfFire\"]", "Volcano"]),5]

RandomEntity[(EntityClass["Europe", EntityClass["Country","Europe"], "EntityClass[\"Country\", \"Europe\"]", "countries"])]

Implicit (RefLink[EntityClass, paclet:ref/EntityClass]) expressions, based on conditional (RefLink[EntityProperty, paclet:ref/EntityProperty]) values, can also be sampled:

RandomEntity[EntityClass["Element","Density" ->(Quantity[Interval[{5,8}], "g""/"(("cm")^3), grams per centimeter cubed, (("Grams")/(("Centimeters")^3))])],3]

OpenersExampleSection3(Spacer1)Possible Issues  (3)

If the sample size is larger than the number of available entities, an error message is issued:

RandomEntity["Planet",10]

The specified type should be an (RefLink[Entity, paclet:ref/Entity]), (RefLink[EntityClass, paclet:ref/EntityClass]), or known entity type:

RandomEntity["Island",4]

RandomEntity["Moth",3]

Sample selection is done using the online Wolfram Knowledgebase, and does not follow client (RefLink[SeedRandom, paclet:ref/SeedRandom]) state:

SeedRandom[1234];
RandomEntity["MinorPlanet",5]

SeedRandom[1234];
RandomEntity["MinorPlanet",5]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Entity, paclet:ref/Entity])  ▪  (RefLink[EntityClass, paclet:ref/EntityClass])  ▪  (RefLink[EntityValue, paclet:ref/EntityValue])  ▪  (RefLink[EntityList, paclet:ref/EntityList])  ▪  (RefLink[EntityClassList, paclet:ref/EntityClassList])  ▪  (RefLink[RandomWord, paclet:ref/RandomWord])  ▪  (RefLink[RandomColor, paclet:ref/RandomColor])  ▪  (RefLink[RandomChoice, paclet:ref/RandomChoice])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Knowledge Representation & Access, paclet:guide/KnowledgeRepresentationAndAccess])}, {▪(RefLinkPlain[Engineering Data, paclet:guide/EngineeringData])}, {▪(RefLinkPlain[Life Sciences & Medicine: Data & Computation, paclet:guide/LifeSciencesAndMedicineDataAndComputation])}, {▪(RefLinkPlain[Cultural Data, paclet:guide/CulturalData])}, {▪(RefLinkPlain[People & History, paclet:guide/PeopleAndHistory])}, {▪(RefLinkPlain[Transportation Data, paclet:guide/TransportationData])}, {▪(RefLinkPlain[Internet and Computer Systems Data, paclet:guide/InternetAndWebRelatedData])}, {▪(RefLinkPlain[Physics & Chemistry: Data and Computation, paclet:guide/PhysicsAndChemistryDataAndComputation])}, {▪(RefLinkPlain[Astronomical Computation & Data, paclet:guide/AstronomicalComputationAndData])}, {▪(RefLinkPlain[Random Number Generation, paclet:guide/RandomNumberGeneration])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/16-real-world-data.html])(WebLink[: Real-World Data, https://www.wolfram.com/language/elementary-introduction/16-real-world-data.html])}})}})