Create a New Project

This sample code shows how to use the API to create a new project under your project and add the recipes to the project.

import requests
from typing import List

def create_project(
    api_key: str, owner: str, name: str, is_public: bool = False,
    description: str = None, recipes: List[dict] = None
    headers = {'x-pollination-token': api_key}
    # create the project
    url = f'{owner}'
    data = {
        'name': name,
        'description': description if description else '',
        'public': is_public
    print(f'Creating project {owner}/{name} ...')
    response =, headers=headers, json=data)
    print(f'Project {owner}/{name} is created!')

    # add the recipes if any
    recipes = recipes or []
    recipe_url = f'{owner}/{name}/recipes/filters'
    for recipe in recipes:
        # each recipe should be formatted as
        # {'owner': 'owner', 'name':'name, 'tag': 'tag'}
        print(f'Adding recipe {recipe} to the project.')
        recipe_response =
            url=recipe_url, headers=headers, json=recipe

Here is an example of using the function to create a project under the Pollination organization.

if __name__ == '__main__':
    api_key = ''  # provide a valid API key
    assert api_key, 'Provide a valid API Key.'
    owner = 'pollination'  # change the owner to your organization
    name = 'Sample Project'
    description = 'This project is created automatically using the API.'
    # see this link for the list of available recipes
    recipes = [
        {'owner': 'ladybug-tools', 'name': 'annual-daylight', 'tag': 'latest'},
        {'owner': 'ladybug-tools', 'name': 'annual-energy-use', 'tag': 'latest'}
        api_key=api_key, owner=owner, name=name, description=description,

Here are the screenshots of the project created using the sample code.

Last updated