Skip to main content

02. Navigate and Search

How to navigate and search through Jinko's API

Jinko's API allows you to navigate through various project items and search for specific resources. This section covers how to perform these actions using the jinko-sdk.

You can retrieve a list of project items, such as models, trials, or virtual populations, by making a request to the appropriate API endpoint. Here’s an example:

import jinko_helpers as jinko

# Example request to get a list of project items
jinko.make_request(
path='/app/v1/project-item',
method='GET'
)

Searching for Project Items by Name

You can search for specific project items using filters such as the project item's name. Here’s how to search for a project item by its name:

import jinko_helpers as jinko

# Search for project items with a specific name
name = "Example Project"

jinko.make_request(
path='/app/v1/project-item',
method='GET',
params={
"name": name
}
)

Searching by Type

You can also search for specific types of project items, such as models or trials. Here’s how to search by type:

import jinko_helpers as jinko

# Search for project items of type 'ComputationalModel' or 'Trial'
types = ['ComputationalModel', 'Trial']

jinko.make_request(
path='/app/v1/project-item',
method='GET',
params={
"type": types
}
)

This method allows you to quickly locate specific project items within your Jinko workspace.