Create Dataset
Easily create a dataset and add metadata and files at the same time via the API.
Method
POST /datasets/{owner}
Parameters
Name | Type | Description | Required |
---|---|---|---|
title | string | Dataset name. 3 to 30 characters. | √ |
description | string | Short description for dataset. Max. 120 characters. | |
summary | string | Dataset summary, markdown supported. Max. 25,000 characters. | |
tags | array | Array of strings to tag dataset. 2 to 25 characters each. Letters, numbers and spaces only. { "tags": [ "tag1", "tag2" ]} |
|
license | string | Public Domain , PDDL , CC-0 , CC-BY , ODC-BY , CC-BY-SA , ODC-ODbL , CC BY-NC-SA or Other See full descriptions |
|
visibility | string | OPEN or PRIVATE |
√ |
files | object | List of files and their sources to add to dataset. |
The files
object contains the following keys:
Name | Type | Description |
---|---|---|
name | string | The filename including the file extension. |
source | object | List of file URLs. |
description | string | Short description for the file. Max. 120 characters. |
labels | array | Array of strings to label file. Acceptable string values are: raw data , clean data , documentation , script , visualization , and report . { "labels": [ "raw data", "report" ]} |
The source
object contains the following keys:
Name | Type | Description |
---|---|---|
url | string | The direct-download URL for each file. |
Body JSON schema
{
"title": "string",
"description": "string",
"summary": "string",
"tags": [
"string"
],
"license": "string",
"visibility": "string",
"files": [
{
"name": "string",
"source": {
"url": "string"
},
"description": "string",
"labels": [
"string"
]
}
]
}
Response JSON schema (Status 200)
{
"message": "string"
}
Errors
HTTP Status Code | Reason | Solution |
---|---|---|
400 | Bad request. | Check syntax and URIs. |
401 | Unauthorized | Verify credentials / API key |
403 | Forbidden | |
404 | Not found. | |
422 | Bad request. | Check syntax and URIs. |
500 | Server error. |
EXAMPLE
Request URL:
https://api.data.world/v0/datasets/jonloyens
cURL:
$ export DW_API_TOKEN=<your api token goes here>
$ curl -H 'Authorization: Bearer ${DW_API_TOKEN}' -H 'Content-Type: application/json' -d @request.json https://api.data.world/v0/datasets/jonloyens
Where @request.json
is a reference to a locally stored file with the JSON request content, as seen below:
{
"title": "data.world basketball team",
"description": "Fake data.world basketball team players and stats",
"summary": "This dataset involves some fake information about the totally fake data.world intramural basketball team.",
"tags": [
"sports", "datadotworld", "basketball"
],
"license": "PDDL",
"visibility": "OPEN",
"files": [
{
"name": "DataDotWorldBBallTeam.csv",
"source": {
"url": "https://docs.google.com/spreadsheets/d/1UheyB6pxTCfLpRmIGITM0fKb8jHVEvPuajmuejxxRyE/pub?gid=1371600687&single=true&output=csv"
},
"description": "Stats about about our purely fictitious basketball team",
"labels": [
"raw data", "clean data"
]
}
]
}
Response Body:
{
"message": "Dataset has been successfully created. Sync in progress."
}