Learn R Programming

orcidtr (version 0.1.0)

orcid_employments: Retrieve employment history from ORCID

Description

Fetches employment records for a given ORCID identifier from the ORCID public API. Returns a structured data.table with employment history including organization names, roles, departments, and dates.

Usage

orcid_employments(orcid_id, token = NULL)

Value

A data.table with the following columns:

orcid

ORCID identifier

put_code

Unique identifier for this employment record

organization

Name of the employing organization

department

Department name (if available)

role

Job title or role

start_date

Employment start date (ISO format)

end_date

Employment end date (ISO format, NA if current)

city

City of organization

region

State/region of organization

country

Country of organization

Returns an empty data.table with the same structure if no employment records are found.

Arguments

orcid_id

Character string. A valid ORCID identifier in the format XXXX-XXXX-XXXX-XXXX. Can also handle URLs like https://orcid.org/XXXX-XXXX-XXXX-XXXX.

token

Character string or NULL. Optional API token for authenticated requests. If NULL (default), checks the ORCID_TOKEN environment variable. Most public data is accessible without authentication.

Details

This function queries the ORCID public API endpoint: https://pub.orcid.org/v3.0/{orcid-id}/employments

The function respects ORCID API rate limits and includes appropriate User-Agent headers identifying the orcidtr package.

References

ORCID API Documentation: https://info.orcid.org/documentation/api-tutorials/

See Also

orcid_educations, orcid_works, orcid_fetch_record

Examples

Run this code
if (FALSE) {
# Fetch employment history for a public ORCID
emp <- orcid_employments("0000-0002-1825-0097")
print(emp)

# With authentication
Sys.setenv(ORCID_TOKEN = "your-token-here")
emp <- orcid_employments("0000-0002-1825-0097")
}

Run the code above in your browser using DataLab