Create Dataset From Project
curl --request POST \
--url https://api.scale.com/v1/nucleus/dataset/create_from_project \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"last_n_tasks": 123,
"name": "<string>"
}
'import requests
url = "https://api.scale.com/v1/nucleus/dataset/create_from_project"
payload = {
"project_id": "<string>",
"last_n_tasks": 123,
"name": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({project_id: '<string>', last_n_tasks: 123, name: '<string>'})
};
fetch('https://api.scale.com/v1/nucleus/dataset/create_from_project', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scale.com/v1/nucleus/dataset/create_from_project",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '<string>',
'last_n_tasks' => 123,
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scale.com/v1/nucleus/dataset/create_from_project"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"last_n_tasks\": 123,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scale.com/v1/nucleus/dataset/create_from_project")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"last_n_tasks\": 123,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scale.com/v1/nucleus/dataset/create_from_project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"last_n_tasks\": 123,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"dataset_id": "ds_bwkezj6g5c4g05gqp1eg",
"job_id": "job_c19xcf9mkws46gah00yg",
"job_last_known_status": "Running",
"job_type": "ingestTasks",
"job_creation_time": "2021-09-21T20:07:13.055Z",
"message": "Importing tasks in the background. You can use the job_id field to asynchronously check the status of this job."
}{}Datasets
Create Dataset From Project
POST
/
dataset
/
create_from_project
Create Dataset From Project
curl --request POST \
--url https://api.scale.com/v1/nucleus/dataset/create_from_project \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"last_n_tasks": 123,
"name": "<string>"
}
'import requests
url = "https://api.scale.com/v1/nucleus/dataset/create_from_project"
payload = {
"project_id": "<string>",
"last_n_tasks": 123,
"name": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({project_id: '<string>', last_n_tasks: 123, name: '<string>'})
};
fetch('https://api.scale.com/v1/nucleus/dataset/create_from_project', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scale.com/v1/nucleus/dataset/create_from_project",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '<string>',
'last_n_tasks' => 123,
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scale.com/v1/nucleus/dataset/create_from_project"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"last_n_tasks\": 123,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scale.com/v1/nucleus/dataset/create_from_project")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"last_n_tasks\": 123,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scale.com/v1/nucleus/dataset/create_from_project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"last_n_tasks\": 123,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"dataset_id": "ds_bwkezj6g5c4g05gqp1eg",
"job_id": "job_c19xcf9mkws46gah00yg",
"job_last_known_status": "Running",
"job_type": "ingestTasks",
"job_creation_time": "2021-09-21T20:07:13.055Z",
"message": "Importing tasks in the background. You can use the job_id field to asynchronously check the status of this job."
}{}Click for Python SDK
NucleusClient.create_dataset_from_project(
project_id: str,
last_n_tasks: Optional[int] = None,
name: Optional[str] = None
) -> Dataset
Annotation, SegmentAnnotation, VideoAnnotation, Categorization, PolygonAnnotation, ImageAnnotation, DocumentTranscription, LidarLinking, or LidarAnnotation projects with Scale, use this endpoint to import your project directly into Nucleus.
You’ll need to specify your Scale project_id and the number of tasks that you want to ingest.
By default, the name of your Dataset will be the same as your project’s name, and will ingest all tasks (both pending and completed) into the resulting dataset. You can override these defaults by using the specified request parameters.
This endpoint is asynchronous because it is possible to have a delay when the number of tasks is larger than 1000. As a result, the endpoint returns the job_id of an AsyncJob, which you can use to check the job’s status (and any errors) via the Check Async Job endpoint.Authorizations
Body
application/json
Response
200