Get in touch

Get in touch

Prefer using email? Say hi at hello@moveshelf.com

This section explains how to retrieve all sessions in a project on Moveshelf using the Moveshelf API. You can optionally filter the results by session date. Filtering is particularly useful when you only need sessions from a specific time period, as it reduces the amount of data retrieved and makes the query more efficient.
Prerequisites
Before implementing this example, ensure that your processing script includes all necessary setup steps. In particular, you should have:
Implementation
To retrieve all sessions in a project within a specific date range, add the following lines of code to your processing script:
## README: this example shows how we can retrieve sessions from Moveshelf 
# using the Moveshelf API.

## General configuration. Set values before running the script
my_project = "<organizationName/projectName>"  # e.g. support/demoProject
session_start_date = None or "<startDate>"  # start date in "YYYY-MM-DD" format or None
session_end_date = None or "<endDate>"  # end date in "YYYY-MM-DD" format or None

## Add here the code to retrieve the project_id
# ... my_project_id = projects[idx_my_project]["id"]

## Get all sessions in the project within the (optional) date range
## Set include_additional_data to True to also retrieve
## clips/trials and data files
sessions = api.getProjectSessions(
    my_project_id,
    start_date=session_start_date,
    end_date=session_end_date,
    include_additional_data=False
)