Advanced search

🚧

New record status values, filters and API behaviors

Beginning 1 Dec 2022, some ROR records contain new values "inactive" and "withdrawn" in the status and new values "Predecessor" and "Successor" in relationships.type. APIs now return records with active status only by default. Records with all statuses can be returned using query parameter ?all_status. See the 2022-12-01 release notes for details about this change.

Advanced search functionality allows searching all ROR record fields using the URL query parameter query.advanced. Complex queries using field names, wildcards, boolean operators, etc can be constructed using Elastic Search query string syntax.

Example queries

Search all fields

To search all ROR record fields, use ?query.advanced=[query]. Queries should be formatted using Elastic Search query string syntax.

  • URL-encode query terms
  • Escape Elastic Search reserved characters
curl 'https://api.ror.org/organizations?query.advanced=Harvard%20University'

🚧

Querying all fields with ?query.advanced=[query] may produce more results than desired. Consider searching one or more specific fields instead, e.g., ?query.advanced=[fieldname:query], as in the example below.

Search a single field

Elastic Search field name syntax fieldname:query can be used to search a single field. When using this syntax, field name must match a field name in the list of available fields exactly (ex: addresses.geonames_city.city:Melbourne not addresses:Melbourne). To search child fields of a parent field see Search all subfields of a parent field.

curl 'https://api.ror.org/organizations?query.advanced=name:Harvard%20University'

Search multiple fields

Combine multiple fields to form complex queries Elastic Search boolean operator syntax (AND, OR, NOT). Note that operators must be surrounded by URL-encoded spaces.

curl 'https://api.ror.org/organizations?query.advanced=name:Cornell+AND+addresses.geonames_city.city:Ithaca'

Search all subfields of a parent field

Elastic Search field name syntax fieldname.\*:query can be used to search all subfields of a parent field. Note that \ characters must be URL-encoded.

curl 'https://api.ror.org/organizations?query.advanced=addresses.%5c*:Melbourne'

Find a records with a non-null value in a field

Elastic Search field name syntax _exists_:[fieldname] can be used to return records that have any non-null value in that field.

🚧

Null vs empty string

Most ROR record fields that have no value are set to null. An exception is wikipedia_url. Empty wikipedia_url values were set to empty strings "" in inherited GRID records.

For some other fields, like addresses.line, most empty values were set to null, but a small number of records inherited from GRID have empty strings.

We plan to change empty strings to null in a future data release, however, currently _exists_:[fieldname] may include results with empty strings for some fields.

curl 'https://api.ror.org/organizations?query.advanced=_exists_:external_ids.ISNI.all'

Paging

As with all ROR API responses, advanced query results are paginated. By default, the first 20 results are returned, and more results can be retrieved with additional requests. See ROR API > Paging for details on retrieving paginated results.

Filtering

As with all ROR API responses, advanced query results can be filtered by type, country code, country name or status using the filter parameter. See ROR API > Filtering for details on filtering.

Record status

As of 1 Dec, 2022 API search/list responses return only records with a status of active by default (see release notes). Add the query parameter ?all_status to return records with all statuses (active, inactive, withdrawn) or filter by status to return records with specific status values. See ROR API > Record status for more information.

Errors & troubleshooting

Incorrect field names

The following cases will cause a field name validation error:

  • Performing fielded searches that contain field names not listed in the table below
  • Searching a parent field name without using a wildcard operator (ex: addresses:Melbourne rather than addresses.%5c*:Melbourne

For example, a query with an incorrect field name will return the following error:

curl 'https://api.ror.org/organizations?query.advanced=address.city:Melbourne'
{"errors":["string 'address.city' contains an illegal field name"]}

Multiple query parameters

Use either query or query.advanced parameter - not both. If both are used, the following error will be returned:

curl 'https://api.ror.org/organizations?query.advanced=name:Cornell&query=Ithaca'
{"errors":["query and query.advanced parameters cannot be combined. please use either query OR query.advanced"]}

Unescaped reserved characters

Elasticsearch reserved characters + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ / used within your search terms must be escaped with a URL-encoded \ character, %5c. If these characters are not escaped, the following issues may occur:

  • Illegal field name error, due to unescaped : character, which is interpreted as a field name
  • 500 error, ex due to unterminated/unescaped special characters
  • Unexpected/non-relevant results, due to special characters being interpreted as query operators rather than as part of your search terms

For additional details, see ROR API > Special characters

Search strings with spaces

Elasticsearch query string syntax will treat words separated by a space as separate parts of a query. It is therefore advisable to surround multi-word search terms of the ROR API with URL-encoded quotation marks.

Available fields

Field nameDescriptionNotes
acronymsAcronyms or initialisms for the organization name
addresses.cityCity that the organization is located inIn new and recently updated records, this value is identical to addresses.geonames_city.city. In records inherited from GRID, this value may be different from addresses.geonames_city.city or missing.
addresses.country_geonames_idGeonames ID for the country that the organization is located in
addresses.geonames_city.cityCity that the organization is located in, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
addresses.geonames_city.geonames_admin1.ascii_nameASCII name for the primary administrative region (ex: US state) that the organization is located in, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
addresses.geonames_city.geonames_admin1.codeCode for the primary administrative region (ex: US state) that the organization is located in, from Geonames database. Typically a FIPs or ISO code.Derived from the Geonames record for the ID addresses.geonames_city.id
addresses.geonames_city.geonames_admin1.nameName of the primary administrative region (ex: US state) that the organization is located in, from Geonames database. May contain non-ASCII characters.Derived from the Geonames record for the ID addresses.geonames_city.id
addresses.geonames_city.geonames_admin2.ascii_nameASCII name for the secondary administrative region (ex: US county) that the organization is located in, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
addresses.geonames_city.geonames_admin2.codeCode for the secondary administrative region (ex: US county) that the organization is located in, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
addresses.geonames_city.geonames_admin2.nameName of the secondary administrative region (ex: US county) that the organization is located in, from Geonames database. May contain non-ASCII characters.Derived from the Geonames record for the ID addresses.geonames_city.id
addresses.geonames_city.idGeonames ID for the city that the organization is located inA small number of organizations are not located in a city. In that case, the code for the nearest legal jurisdiction is used.
addresses.geonames_city.license.attributionLicense attribution for Geonames dataValue in all records is Data from geonames.org under a CC-BY 3.0 license
addresses.geonames_city.license.licenseLicense URL for Geonames dataValue in all records is http://creativecommons.org/licenses/by/3.0
addresses.geonames_city.nuts_level1.codeCode for the NUTS level 1 region that the organization is located in, from Geonames databaseDEPRECATED. This field does not have a value in new and recently updated records, and values in existing records are not maintained.
addresses.geonames_city.nuts_level1.nameName of the NUTS level 1 region that the organization is located in, from Geonames databaseDEPRECATED. This field does not have a value in new and recently updated records, and values in existing records are not maintained.
addresses.geonames_city.nuts_level2.codeCode for the NUTS level 2 region that the organization is located in, from Geonames databaseDEPRECATED. This field does not have a value in new and recently updated records, and values in existing records are not maintained.
addresses.geonames_city.nuts_level2.nameName of the NUTS level 2 region that the organization is located in, from Geonames databaseDEPRECATED. This field does not have a value in new and recently updated records, and values in existing records are not maintained.
addresses.geonames_city.nuts_level3.codeCode for the NUTS level 3 region that the organization is located in, from Geonames databaseDEPRECATED. This field does not have a value in new and recently updated records, and values in existing records are not maintained.
addresses.geonames_city.nuts_level3.nameName of the NUTS level 3 region that the organization is located in, from Geonames databaseDEPRECATED. This field does not have a value in new and recently updated records, and values in existing records are not maintained.
addresses.latLatitude of the location identified in addresses.geonames_city.id, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
addresses.lineA line of the address for the organizationDEPRECATED. Value is null or empty string for all ROR records.
addresses.lngLongitude of the location identified in addresses.geonames_city.id, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
addresses.postcodePostcode/zipcode that the organization is located inDEPRECATED. Value is null for most records. A small number of records inherited from GRID have lat/long data incorrectly stored in this field. This will be corrected in a future ROR data release.
addresses.primaryIf there is more than one address, identifies the main locationDEPRECATED. Value is false in all ROR records.
addresses.stateState that the organization is located inDEPRECATED. This field does not have a value in new records and values in existing records are not maintained. SUPERSEDED by addresses.geonames_city.geonames_admin1.name
addresses.state_codeCode for the state that the organization is located inDEPRECATED. This field does not have a value in new records and values in existing records are not maintained. SUPERSEDED by addresses.geonames_city.geonames_admin1.code
aliasesOther names the organization is known by
country.country_codeISO 3166-2 code for the country that the organization is located in, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
country.country_nameName of the country that the organization is located in, from Geonames databaseDerived from the Geonames record for the ID addresses.geonames_city.id
email_addressA contact mail address for the organizationDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
establishedYear the organization was established (CE)
external_ids.CNRS.allAll CNRS identifiers for the organizationDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.CNRS.preferredPreferred CNRS identifier for the organization, if one existsDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.FundRef.allAll FundRef (Crossref Funder Registry) identifiers for the organization
external_ids.FundRef.preferredPreferred FundRef (Crossref Funder Registry) identifier for the organization, if one exists
external_ids.GRID.allAll GRID identifiers for the organizationDEPRECATED. This field does not have a value in new records and values in existing records are not maintained. Public GRID registry no longer exists.
external_ids.GRID.preferredPreferred GRID identifier for the organization, if one existsDEPRECATED. This field does not have a value in new records and values in existing records are not maintained. Public GRID registry no longer exists.
external_ids.HESA.allAll HESA identifiers for the organizationDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.HESA.preferredPreferred HESA identifier for the organization, if one existsDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.ISNI.allAll ISNI identifiers for the organization
external_ids.ISNI.preferredPreferred ISNI identifier for the organization, if one exists
external_ids.OrgRef.allAll OrgRef identifiers for the organizationDEPRECATED. This field does not have a value in new records and values in existing records are not maintained. OrgRef registry no longer exists.
external_ids.OrgRef.preferredPreferred OrgRef identifier for the organization, if one existsDEPRECATED. This field does not have a value in new records and values in existing records are not maintained. OrgRef registry no longer exists.
external_ids.UCAS.allAll UCAS identifiers for the organizationDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.UCAS.preferredPreferred UCAS identifier for the organization, if one existsDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.UKPRNS.allAll UKPRNS identifiers for the organizationDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.UKPRNS.preferredPreferred UKPRNS identifier for the organization, if one existsDEPRECATED. This field does not have a value in new records and values in existing records are not maintained.
external_ids.Wikidata.allAll Wikidata identifiers for the organization
external_ids.Wikidata.preferredPreferred Wikidata identifier for the organization, if one exists
idUnique ROR ID for the organizationValue is full ROR ID URL
ip_addressesIP address(es) associated with the organizationDEPRECATED. This field does not have a value in new or existing records. Records inherited from GRID did not have values in this field.
labels.iso639ISO 639-1 language code that identifies the language of a value in labels.label
labels.labelName for the organization in another language
linksOfficial website of the organizationThis field supports multiple URLs, but in practice, each record has either 1 or 0 URLs.
nameThe primary name of the organization
relationships.idUnique ROR ID of another organization which is related to the organizationValue is full ROR ID URL
relationships.labelName of another organization identified in relationships.id, which is related to the organization
relationships.typeType of relationship between the organization and another organization identified in relationships.idAllowed relationship types: Parent, Child, Related, Successor, Predecessor
statusWhether the organization is active or notAllowed values: active, inactive, withdrawn
typesOrganization typeAllowed types: Education, Healthcare, Company, Archive, Nonprofit, Government, Facility, Other
wikipedia_urlWikipedia page link for the organization

How is this different from the existing ?query search?

?query.advanced searches Elastic Search documents that contain all fields/subfields in all ROR records. Field names and hierarchy are preserved.

?query searches abbreviated Elastic Search documents (called "names_ids") that combine all the values from each ROR record's name, aliases, labels, acronyms, id, and external_ids fields. For labels and external IDs, only the values (not the language code or type are included). Field names are removed, and each value is simply categorized as a "name" or "id".

Example names_ids document (truncated)

"names_ids" : [
            {
              "name" : "University of Wisconsin–Madison"
            },
            {
              "name" : "Université du Wisconsin à Madison"
            },
            {
              "name" : "Universidad de Wisconsin-Madison"
            },
            {
              "name" : "UW–Madison"
            },
            {
              "name" : "UW"
            },
            {
              "id" : "https://ror.org/01y2jtd41"
            },
            {
              "id" : "ror.org/01y2jtd41"
            },
            {
              "id" : "01y2jtd41"
            },
...