QuantConnect API

Files

Introduction

This page explains how to create and manage project files in the Research Environment with the QuantConnect API.

Prerequisites

Working knowledge of C#.

Working knowledge of Python.

Create Files

To add a file to a project, call the AddProjectFile method with the project ID, file name, and file content.

var response = api.AddProjectFile(projectId, fileName, content);
response = api.AddProjectFile(project_id, file_name, content)

The AddProjectFile method returns a ProjectFilesResponse object, which have the following attributes:

Read Files

To get details on all the files in a project, call the ReadProjectFiles method with the project ID.

var response = api.ReadProjectFiles(projectId);
response = api.ReadProjectFiles(project_id)

To get details on a specific file in a project, call the ReadProjectFile method with the project ID and file name.

var response = api.ReadProjectFile(projectId, fileName);
response = api.ReadProjectFile(project_id, file_name)

The ReadProjectFiles and ReadProjectFile methods return a ProjectFilesResponse object, which have the following attributes:

Update Files

To update a file name, call the UpdateProjectFileName method with the project ID, the old file name, and the new file name.

var response = api.UpdateProjectFileName(projectId, oldFileName, newFileName);
response = api.UpdateProjectFileName(project_id, old_file_name, new_file_name)

To update the content of a file, call the UpdateProjectFileContent method with the project ID, the file name, and the new content.

var response = api.UpdateProjectFileContent(projectId, fileName, newContent);
response = api.UpdateProjectFileContent(project_id, file_name, new_content)

The UpdateProjectFileName and UpdateProjectFileContent methods return a RestResponse object, which have the following attributes:

Delete Files

To delete a file in a project, call the DeleteProjectFile method with the project ID and file name.

var response = api.DeleteProjectFile(projectId, fileName);
response = api.DeleteProjectFile(project_id, file_name)

The DeleteProjectFile method returns a RestResponse object, which have the following attributes:

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: