The prolific.api package

Introduction

The prolific.api package provides an interface for creating and managing empirical crowd-sourcing studies on prolific.co from R.

A number of prescreening characteristics can be used to recruit specific groups of participants for a study on prolific.co. Especially when these prescreeners are used for splitting up a total sample size into different relevant groups, an increasing number of parallel studies have to be created and managed. prolific.api serves as an interface for doing this in a (semi-)automatic manner from R, e.g. by using a common study template and changing only a few parameters between studies.

Note: An API token is required for accessing the API of prolific.co. For more details, see the section on obtaining an API token.

Core Functionalities

The main functionalities in three ReferenceClasses :

Class Functionality
api_access - Access the API
- Submit and retrieve information
prolific_study - Set up and modify studies
prolific_prescreener - Define the group of eligible participants

In general, all fields and methods of these classes are available in a RefClass as well as S4 object style (see the section on methods and fields access ). The core functionalities are summarized below.

Submitting and retrieving information: The api_access class

The api_access class is designed for interacting with Prolific’s API. The central method to achieve this is access, which can be used to exchange (retrieve and submit) information with the API.

Setting up an api_access

An api_access object can be created by

prolific_api_access <- api_access(api_token = "<api_token>")

While all other settings when creating an api_access rarely require adjustment, the api_token is the information that needs to be specified for the API access to work. The prolific.api package’s functionality heavily depends on a a valid api_token. Therefore, the above command prints a console message to indicate that the token is valid:

The token’s validity can also be checked by means of the check_authorization method, which returns TRUE if the token is valid, and FALSE if it is not:

prolific_api_access$check_authorization()
#> [1] TRUE

The section on obtaining an API token describes how to obtain a valid token.

Using an api_access

The actual API access is carried out by means of the access method of the api_access class. The access method wraps different methods for exchanging information with the API that serve different purposes:

Method Functionality
get Retrieving endpoint / data
post Create an endpoint / send data
patch Apply changes to an endpoint
put Replace an endpoint with new data
delete Delete an endpoint

This table lists the available methods, which are specified in the method argument of the access method. By default, file transfer is based on curl.

For retrieving information from prolific.co using the get method, a simple example is

prolific_api_access$access(
  method = "get",
  endpoint = "users/me"
)

to obtain information about the account you are accessing the API with.

A simple example for submitting information to the API using the post method is

prolific_api_access$access(
  endpoint = "study-cost-calculator",
  method = "post",
  data = list(
    reward = 100,
    total_available_places = 5
  )
)

to calculate the cost (including fees and taxes) of a study where 5 participants are paid 1 £ each.

More realistic examples are provided in the sections below, while a list of further endpoints is provided in
Prolific’s API documentation.

Set-up and change studies: The prolific_study class

The prolific_study class provides a lightweight interface for creating, managing and modifying studies on prolific.co using R. There are a lot of options to be chosen from when setting up such a study, but let’s start with a simple example.

Creating a prolific_study

A minimal specification for creating a prolific_study contains the following information:

new_study <- prolific_study(
  # Information shown to participants
  name = "<Publicly visible study name>",
  description = "<Publicly visible study description>",
  estimated_completion_time = 1,
  reward = 10,
  # URL participants are redirected to
  external_study_url = "https://www.link_to_my_study.com",
  # Completion code to verify participation
  completion_code = "123",
  # Number of participants to recruit
  total_available_places = 10,
  eligibility_requirements =
    list(
      participant_id_prescreener
    )
)

The information that is presented to the potential participants contains the study’s

  • name,
  • description,
  • estimated completion time,
  • reward and
  • total available places.

To them, the study will then will be presented as

Dashboard summary of the Prolific Study

in the dashboard. Once they select the study in the dashboard, more details are shown:

Details of the Prolific Study

People deciding to take part in a study can click on “Take part in this study”, which redirects them to the

  • external study url

where the study is conducted. Once they completed your study, you should provide them with a

  • completion code

and redirect them back to prolific.co. Participant compensation is then based on the completion code by checking whether a participant obtained the correct completion code after completing the study. The compensation does not happen automatically, so you still can check which participants are compensated, e.g. in case of erroneous completion codes.

The above fields are the ones that need to be set in a minimal study specification. For an exhaustive overview of the fields in a prolific_study, see the section on methods and fields access and the documentation help(prolific_study).

Posting a prolific_study on the platform

After creating or changing a prolific_study in R, the study can be submitted to prolific.co to represent it on the platform.

To submit the new_study created above to the Prolific platform, we use

prolific_api_access$access(
  endpoint = "studies",
  method = "post",
  data = new_study
)
#> ======================================================================
#> Prolific study summary:
#> ======================================================================
#> name:                      <Publicly visible study name>
#> internal_name:             
#> id:                        64648077334b5b48eebef880
#> project:                   61f12ae112c02bba9e3523b1
#> external_study_url:        https://www.link_to_my_study.com
#> total_available_places:    10
#> reward:                    10
#> ======================================================================

The output shows that the study has been assigned an id ("64648077334b5b48eebef880" in this case). This id is determined by prolific.co, and the unique identifier for the study on the platform. You can now also find the study in the webinterface.

Getting a prolific_study from the platform

The study’s id is also required if you want to obtain a previously created study from prolific.co. For a study that is not yet represented in an R object, we first need to find out its id.

A list of all studies in the Prolific account can be obtained via

# If the study ID is unknown, you can obtain a list of all studies:
list_of_studies <-
  prolific_api_access$access(
    endpoint = "studies",
    method = "get"
  )

which in this case includes only the new study created above:

print(list_of_studies)
#>    creation_day creation_time internal_name
#> 1:   2023-05-17      07:21:27              
#>                             name                       id study_type
#> 1: <Publicly visible study name> 64648077334b5b48eebef880     SINGLE
#>    total_available_places places_taken reward
#> 1:                     10            0     10
#>    max_submissions_per_participant max_concurrent_submissions
#> 1:                               1                         -1
#>         status number_of_submissions total_cost stratum publish_at
#> 1: UNPUBLISHED                     0      139.9      NA         NA
#>    is_underpaying below_prolific_min below_original_estimate
#> 1:             NA                 NA                      NA
#>    quota_requirements is_reallocated privacy_notice
#> 1:                 NA          FALSE             NA

To retrieve the study from the API, we use the study’s endpoint, which is "studies/64648077334b5b48eebef880":

# Obtain the study with ID 64648077334b5b48eebef880 from Prolific
obtained_study <- 
    prolific_api_access$access(
        endpoint = c("studies","64648077334b5b48eebef880"),
        method = "get"
)

Note that the endpoint argument may be a vector, which is then collapsed using /.

Updating Fields in a prolific_study

The fields in a prolific_study can be changed using either S4 and RefClass syntax (see the section on methods and fields access ). For example, you can change the name of new_study using either one:

# S4 class style
name(new_study) <- "How to create and update studies on Prolific"
# Refclass style
new_study$name <- "How to create and update studies on Prolific"

Both lines of code have the same effect: The name of new_study is now “How to create and update studies on Prolific”. Equivalent access works for all other fields in prolific_study objects, which are listed in the section on methods and fields access and the documentation help(prolific_study).

Changing a prolific_study on the platform

To actually apply the changes made in the previous paragraph to the study on prolific.co, prolific_api_access$access with method = "patch" or method = "put" is used:

# Patch new_study on Prolific
prolific_api_access$access(
    endpoint = c("studies",new_study$id),
    method = "patch",
    data = 
)
#> ======================================================================
#> Prolific study summary:
#> ======================================================================
#> name:                      <Publicly visible study name>
#> internal_name:             
#> id:                        64648077334b5b48eebef880
#> project:                   61f12ae112c02bba9e3523b1
#> external_study_url:        https://www.link_to_my_study.com
#> total_available_places:    10
#> reward:                    10
#> ======================================================================

method = "patch" applies all changes made to the study while retaining the settings that are unchanged. In contrast, method = "put" can be used to overwrite an existing study with an entirely new study specification. In many cases, the effect will be the same - but empty fields in a prolific_study will not be changed when using "patch", but will be deleted when using "put".

Deleting a prolific_study on the platform

Ultimately, a study can be deleted using access with method = "delete" on the study’s endpoint

# Delete new_study on Prolific
prolific_api_access$access(
    endpoint = c("studies",new_study$id),
    method = "delete"
)

Defining eligible participants: The prolific_prescreener class

prolific_prescreener objects are used for characterizing the participants to be selected. In that sense, they contain a description of the person’s to be recruited in a prolific_study. Various characteristics are available to define this target group. An exhaustive list is provided in the list of available prescreeners.

Setting up prolific_prescreeners

To make a simple example, participants who currently live in the United States can be selected using the prolific_prescreener

us_prescreener <-
  prolific_prescreener(
    title = "Current Country of Residence",
    "United States"
  )

You can combine multiple constraints for a single prescreener. To extend the above prescreener to also allow for participants from the UK, use

uk_us_prescreener <-
  prolific_prescreener(
    title = "Current Country of Residence",
    "United Kingdom",
    "United States"
  )

Some of the prescreeners allow to specify lower and upper boundaries for a numerical variable. For example, participants with an age between 20 and 24 can be selected using the prolific_prescreener

age_prescreener <-
  prolific_prescreener(
    title = "Age",
    "Minimum Age" = 20,
    "Maximum Age" = 24
  )

Using prolific_prescreeners

The prescreeners can be combined in a list and included as the eligibility_requirements field of a prolific_study:

new_study_with_prescreeners <- prolific_study(
  # Information shown to participants
  name = "<Publicly visible study name>",
  description = "<Publicly visible study description>",
  estimated_completion_time = 1,
  reward = 10,
  # URL participants are redirected to
  external_study_url = "https://www.link_to_my_study.com",
  # Completion code to verify participation
  completion_code = "123",
  # Number of participants to recruit
  total_available_places = 10,
  # Constraints that participants have to meet
  eligibility_requirements = list(
    uk_us_prescreener,
    age_prescreener
  )
)

This example creates a study that has the same information as new_study above, but is available only for persons living in the UK or US who are between 20 and 24 years of age.

As above, the study can be submitted to prolific.co using

prolific_api_access$access(
  endpoint = "studies",
  method = "post",
  data = new_study_with_prescreeners
)

To add, remove or change prescreeners in an existing prolific_study, simply
modify the study’s eligibility_requirements field, as described (see the section on updating fields in a prolific_study ). For example, the age requirement specified for new_study_with_prescreeners can be relaxed to allow for participants between the ages of 18 and 28:

new_study_with_prescreeners$eligibility_requirements$
  `Age`$constraints <- list(
  "Minimum Age" = 18,
  "Maximum Age" = 28
)

To limit the study to persons living in the US (i.e. exclude the previously included UK inhabitants), use

new_study_with_prescreeners$eligibility_requirements$
  `Current Country of Residence` <- us_prescreener

The changes can be applied as described in the section on changing a prolific_study on the platform

A full searchable list of all currently available prescreeners (as of 2023-05-17) is available in the following list of available prescreeners. It also includes example code snippets for each prescreener and available constraints.

List of available prolific_prescreeners

The following table contains all 301 currently (as of 2023-05-17) available prescreeners. The prescreener title is to be used in the title field of a prolific_prescreener object.

Click on the respective row to show all available constraints

Click on the respective constraint to show R-code for setting up the prescreener

Prescreener title
Category
Subcategory
Current Country of Residence
Demographics
Age
Demographics
Nationality
Demographics
Nationality (UK)
Demographics
Sex
Demographics
Ethnicity (Simplified)
Demographics
Ethnicity
Demographics
Sexual Orientation
Demographics
Relationship/Marital status
Demographics
Gender
Demographics
Cisgender and Transgender
Demographics
LGBTQ+
Demographics
Gender identity non-binary only
Demographics
Years lived in current country of residence
Geographic
Country of Birth
Geographic
Places lived in the past
Immigration
Geographic
Places lived in the past
Living abroad
Geographic
Places lived in the past
Moved with partner
Geographic
Places lived in the past
Mono/multi cultural
Geographic
Places lived in the past
Place of most time spent before turning 18
Geographic
Places lived in the past
UK area of birth
Geographic
UK
Current UK area of residence
Geographic
UK
UK Postcode area
Geographic
UK
U.S state/territory of birth
Geographic
USA
Current U.S state of residence
Geographic
USA
First Language
Languages
Fluent languages
Languages
English speaking Monolingual
Languages
Were you raised monolingual?
Languages
Bilingual
Languages
Language related disorders
Languages
Primary Language
Languages
Earliest Language in Life
Languages
Custom Whitelist
Custom Screener
Custom Blacklist
Custom Screener
Employment Status
Work
Job Seeking
Work
Experiences at Work
Work
Commute/travel to work
Work
Remote/office work
Work
Working hours
Work
Work week in hours
Work
Entrepreneurship
Work
Startup
Work
Technology use at work
Work
Teacher
Work
Safety procedures at work
Work
Negotiation Experience
Work
Company size
Work
Retirement Status
Work
Annual Business Turnover
Work
Business Travel
Work
COVID-19 Employment Status
Work
Covid 19
COVID-19 Working From Home
Work
Covid 19
Employment-Sector
Work
Employment sector
Employment Sector within Business Management and Administration
Work
Employment sector
Employment Sector within Medicine/Healthcare
Work
Employment sector
Past Employment Sectors
Work
Employment sector
Industry
Work
Employment sector
Industry Role
Work
Employment sector
Company type
Work
Employment sector
Employer Type
Work
Employment sector
Organizational tenure
Work
Employment sector
Military veteran
Work
Employment sector
Business Role
Work
Employment sector
Employment in UK Services
Work
Employment sector
Employee interactions
Work
Interactions at work
Workgroups
Work
Interactions at work
Supervisor
Work
Interactions at work
Colleague
Work
Interactions at work
Customer facing
Work
Interactions at work
Number of subordinates
Work
Interactions at work
Leadership/Position of power/Supervisory duties
Work
Responsibility
Management experience
Work
Responsibility
Hiring experience
Work
Responsibility
Years of Management Experience
Work
Responsibility
Decision-making responsibilities
Work
Responsibility
Highest education level completed
Education
Subject
Education
Undergraduate year of study
Education
Literacy Difficulties
Education
Highest level of education completed by parents
Education
Student Status
Education
Student
Current education level
Education
Student
Further educational study
Education
Student
Interest in studying abroad
Education
Student
Studying abroad
Education
Student
Health Insurance (US)
Health
Neurodiversity
Health
Oral Contraceptives
Health
Blood type
Health
Telemedicine
Health
Healthcare provider consultation
Health
Dyslexia
Health
Prescription Medications
Health
Units of alcohol
Health
Alcohol consumption
Alcohol therapy
Health
Alcohol consumption
COVID-19 Vaccination
Health
Covid 19
Vaccine Opinions 2
Health
Covid 19
COVID-19 Symptoms
Health
Covid 19
COVID-19 Vaccination History
Health
Covid 19
Diet
Health
Food & Diet
Lost weight recently
Health
Food & Diet
Past Diet
Health
Food & Diet
Restricted food intake
Health
Food & Diet
Body Weight
Health
Food & Diet
Body Mass Index
Health
Food & Diet
Head Injury
Health
Head Injury
Head Injury: Knock out history
Health
Head Injury
Long-term health condition/disability
Health
Long term & Chronic diseases
Long-term health condition or disability
Health
Long term & Chronic diseases
Chronic condition/illness
Health
Long term & Chronic diseases
Chronic Disease
Health
Long term & Chronic diseases
Diabetes type
Health
Long term & Chronic diseases
Respiratory disease
Health
Long term & Chronic diseases
Multiple sclerosis
Health
Long term & Chronic diseases
Heart Issues
Health
Long term & Chronic diseases
Coronary artery disease
Health
Long term & Chronic diseases
NHS Mental Health Support
Health
Mental Health
Mental health/illness/condition - ongoing
Health
Mental Health
Mild cognitive impairment/Dementia
Health
Mental Health
Autism Spectrum Disorder
Health
Mental Health
Mental illness daily impact
Health
Mental Health
Antidepressants
Health
Mental Health
Medication use
Health
Mental Health
Depression
Health
Mental Health
Anxiety
Health
Mental Health
ADD/ADHD
Health
Mental Health
Anxiety Severity
Health
Mental Health
Mental Health Diagnosis
Health
Mental Health
Mental Health Treatment
Health
Mental Health
Pain - duration
Health
Pain
Pain Question
Health
Pain
Smoking: Tobacco or e-cigarettes
Health
Smoking
Smoking status
Health
Smoking
Smoking frequency
Health
Smoking
Vaping status
Health
Smoking
Quit smoking
Health
Smoking
Corrected vision
Health
Vision & Hearing
Hearing difficulties
Health
Vision & Hearing
Vision
Health
Vision & Hearing
Cochlear implant
Health
Vision & Hearing
Colourblindness
Health
Vision & Hearing
ProLife/ProChoice
Beliefs
COVID-19 Vaccine Opinions
Beliefs
Boycotting
Beliefs
Climate Change
Beliefs
Environment
Concern about environmental issues
Beliefs
Environment
Windfarms
Beliefs
Environment
Political Affiliation (UK)
Beliefs
Political
Political Party Affiliation UK
Beliefs
Political
UK General Election 2019
Beliefs
Political
UK general election 2017
Beliefs
Political
BREXIT
Beliefs
Political
Political Spectrum (US)
Beliefs
Political
U.S. Political Affiliation
Beliefs
Political
US Presidential election
Beliefs
Political
2020 US presidential election
Beliefs
Political
2016 US presidential election
Beliefs
Political
Religious Affiliation
Beliefs
Religious
Non-Religious
Beliefs
Religious
Participation in regular religious activities
Beliefs
Religious
Christianity Affiliation (New)
Beliefs
Religious
Informal/unpaid caring responsibilites
Family & relationships
Children
Family & relationships
Number of children
Family & relationships
Parenthood
Year of birth of first child
Family & relationships
Parenthood
Year of birth of youngest child
Family & relationships
Parenthood
Month of birth of youngest child
Family & relationships
Parenthood
Living with biological child
Family & relationships
Parenthood
Living with biological child's parent
Family & relationships
Parenthood
Living with family
Family & relationships
Parenthood
Household Size
Family & relationships
Parenthood
Pregnancy
Family & relationships
Pregnancy
Pregnancy (partners)
Family & relationships
Pregnancy
Dating apps
Family & relationships
Romantic relationship
Romantic Relationship
Family & relationships
Romantic relationship
Romantic Relationship 2
Family & relationships
Romantic relationship
Living with spouse/partner
Family & relationships
Romantic relationship
Sexual partner
Family & relationships
Romantic relationship
Number of romantic partners
Family & relationships
Romantic relationship
Gender Identity of Romantic Partners
Family & relationships
Romantic relationship
Number of Siblings
Family & relationships
Siblings
Siblings
Family & relationships
Siblings
Hobbies - Categories
Lifestyle and interests
Pets
Lifestyle and interests
Game types
Lifestyle and interests
Team/Individual Sport
Lifestyle and interests
Music Streaming Services
Lifestyle and interests
Experience with musical instruments
Lifestyle and interests
Arts
Type of musical instrument(s)
Lifestyle and interests
Arts
Meditation
Lifestyle and interests
Meditation
English Premier League Fan
Lifestyle and interests
Sports
Weekly Exercise
Lifestyle and interests
Sports
Team Sports
Lifestyle and interests
Sports
Watching Sports
Lifestyle and interests
Sports
High School/College/University Sports
Lifestyle and interests
Sports
Devices with screens
Technology and online behaviour
General use
Weekly device usage
Technology and online behaviour
General use
Internet enabled products
Technology and online behaviour
General use
Children and technology
Technology and online behaviour
General use
Cell Phone Service [US participants only]
Technology and online behaviour
General use
Mobile Phone Service [UK participants only]
Technology and online behaviour
General use
Home Internet Provider U.K
Technology and online behaviour
General use
Home Internet Provider U.S.
Technology and online behaviour
General use
TV Streaming Services
Technology and online behaviour
General use
Assistive Technology
Technology and online behaviour
General use
Cloud storage solutions
Technology and online behaviour
General use
Video Games
Technology and online behaviour
Online Gaming
VR headset (ownership)
Technology and online behaviour
Online Gaming
VR headset (frequency)
Technology and online behaviour
Online Gaming
Simulated Experiences
Technology and online behaviour
Online Gaming
Online gambling games
Technology and online behaviour
Online behaviour
Internet pornography
Technology and online behaviour
Online behaviour
Computer Programming
Technology and online behaviour
Skills
Knowledge of software development techniques
Technology and online behaviour
Skills
Touch typing
Technology and online behaviour
Skills
Camera usage
Technology and online behaviour
Skills
Programming Languages
Technology and online behaviour
Skills
Tweeting Frequency
Technology and online behaviour
Social Media
Social-Media
Technology and online behaviour
Social Media
Chat/Messaging apps
Technology and online behaviour
Social Media
Fashion brand purchases
Shopping and consumer habits
Free From Products
Shopping and consumer habits
Luxury Goods
Shopping and consumer habits
Primary Grocery Shopper
Shopping and consumer habits
Consumer review websites
Shopping and consumer habits
Food Delivery Services UK
Shopping and consumer habits
Food Delivery Services U.S.
Shopping and consumer habits
Airlines
Shopping and consumer habits
Active subscriptions
Shopping and consumer habits
Soft drink types
Shopping and consumer habits
Drinks
Alcohol types
Shopping and consumer habits
Drinks
Alcohol preferences
Shopping and consumer habits
Drinks
Online shopping
Shopping and consumer habits
Online Shopping
Online Shopping Frequency
Shopping and consumer habits
Online Shopping
Groceries online
Shopping and consumer habits
Online Shopping
Clothing online
Shopping and consumer habits
Online Shopping
Handedness
Other
Jury duty
Other
Driving licence
Other
Charity Affiliation
Other
Diet Restriction
Other
Car Brand
Other
Video call interview
Other
Prison
Other
Crime
Crime victim
Other
Crime
Crime incidents
Other
Crime
Car usage
Other
Travelling
Ridesharing services
Other
Travelling
Trips Abroad
Other
Travelling
Car Model Year
Other
Travelling
Driving Frequency
Other
Travelling
Future Car Ownership
Other
Travelling
Listening habits while driving
Other
Travelling
Exclude participants from previous studies
Participation on Prolific
Include participants from previous studies
Participation on Prolific
Approval Rate
Participation on Prolific
Number of previous submissions
Participation on Prolific
Participant registered before date
Participation on Prolific
Participant registered after date
Participation on Prolific
Confidentiality agreement
Participation on Prolific
Participation in different types of studies
Deception
Participation on Prolific
Participation in different types of studies
Record Video
Participation on Prolific
Participation in different types of studies
Participating together with a romantic partner on Prolific
Participation on Prolific
Participation in different types of studies
Other crowdsourcing platforms
Participation on Prolific
Participation in different types of studies
Other crowdsourcing platforms select
Participation on Prolific
Participation in different types of studies
Record Audio
Participation on Prolific
Participation in different types of studies
Participating together with a friend on Prolific
Participation on Prolific
Participation in different types of studies
Harmful Content
Participation on Prolific
Participation in different types of studies
Webcam
Participation on Prolific
Technology use
Computer operating system
Participation on Prolific
Technology use
Phone Operating System
Participation on Prolific
Technology use
Android OS version
Participation on Prolific
Technology use
iPhone model
Participation on Prolific
Technology use
Credit cards
Finance
Charitable Giving
Finance
Socioeconomic Status
Finance
Retirement Plan
Finance
NFT experience
Finance
Investment
Finance
Investment
Types of investment
Finance
Investment
Evaluating a company's stock as a potential investment
Finance
Investment
Cryptocurrency
Finance
Investment
Cryptocurrency Exchanges
Finance
Investment
Trading Platforms
Finance
Investment
Do you own or lease a car?
Finance
Ownership
Property Ownership
Finance
Ownership
Property Type
Finance
Ownership
EV Charging
Finance
Ownership
Household electric vehicle ownership or leasing
Finance
Ownership
Personal Income (GBP)
Finance
Personal and household
Household Income (USD) [US participants only]
Finance
Personal and household
Household Income (GBP)
Finance
Personal and household
Household spending decisions
Finance
Personal and household
Household bill paying
Finance
Personal and household
Universal Credit
Finance
Personal and household
Bank Account
Finance
Personal and household
Pension Income
Finance
Personal and household
Pension Plan
Finance
Personal and household
Insurance types
Finance
Personal and household

Methods and fields – RefClass and S4 syntax overview

All fields and methods in the prolific.api package are available in a RefClass as well as S4 syntax style. For example, the api_token of an api_access object can be accessed by

prolific_api_access$api_token
#> [1] "<api_token>"

as well as

api_token(prolific_api_access)
#> [1] "<api_token>"

Both options are equivalent and can be used for assignment:

prolific_api_access$api_token <- "<new_api_token>"
#> API token status: invalid
#>   API access failed!

does the same as

api_token(prolific_api_access) <- "<new_api_token>"
#> API token status: invalid
#>   API access failed!

and the console messages indicate that "<new_api_token>" is not valid for authentication. All fields in prolific.api classes can be assigned in a corresponding manner. An overview of all fields and methods together with corresponding RefClass and S4 code snippets is provided in the following list:

api_access
fields
methods
prolific_study
fields
methods
prolific_prescreener
fields
methods

Obtaining an API token

The prolific.api package requires an API token for accessing the API of prolific.co. To get such a token, you first need a researcher account on prolific.co. When logging in to this account, you can obtain the token in the Settings -> Go to API token page menu.