代码拉取完成,页面将自动刷新
# Copyright 2018 Kaggle Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
swagger: "2.0"
info:
description: API for kaggle.com
version: "1"
title: Kaggle API
termsOfService: https://www.kaggle.com/terms
contact:
name: Contact Kaggle
url: https://www.kaggle.com/contact
host: www.kaggle.com
basePath: /api/v1
schemes:
- https
securityDefinitions:
basicAuth:
type: basic
security:
- basicAuth: []
externalDocs:
description: Further Kaggle documentation
url: www.kaggle.com
tags:
- name: kaggle
parameters:
guidParam:
in: path
name: guid
required: true
type: string
minimum: 0
description: guid specifies location where submission should be uploaded
paths:
/competitions/list:
get:
tags:
- kaggle
summary: List competitions
operationId: CompetitionsList
produces:
- application/json
parameters:
- in: query
name: group
type: string
enum: [general, entered, inClass]
default: general
description: Filter competitions by a particular group
- in: query
name: category
type: string
enum: [all, featured, research, recruitment, gettingStarted, masters, playground]
default: all
description: Filter competitions by a particular category
- in: query
name: sortBy
type: string
enum: [grouped, prize, earliestDeadline, latestDeadline, numberOfTeams, recentlyCreated]
default: latestDeadline
description: Sort the results
- in: query
name: page
type: integer
default: 1
description: Page number
- in: query
name: search
type: string
default: ''
description: Search terms
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/submissions/list/{id}:
get:
tags:
- kaggle
summary: List competition submissions
operationId: CompetitionsSubmissionsList
produces:
- application/json
parameters:
- in: path
name: id
required: true
type: string
description: Competition name
- in: query
name: page
required: false
type: integer
default: 1
description: Page number
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/{id}/submissions/url/{contentLength}/{lastModifiedDateUtc}:
post:
tags:
- kaggle
summary: Generate competition submission URL
operationId: CompetitionsSubmissionsUrl
produces:
- application/json
consumes:
- multipart/form-data
parameters:
- in: formData
name: fileName
required: false
type: string
description: Competition submission file name
- in: path
name: id
required: true
type: string
description: Competition name, as it appears in the competition's URL
- in: path
name: contentLength
required: true
type: integer
description: Content length of file in bytes
- in: path
name: lastModifiedDateUtc
required: true
type: integer
description: Last modified date of file in milliseconds since epoch in UTC
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/submissions/upload/{guid}/{contentLength}/{lastModifiedDateUtc}:
post:
tags:
- kaggle
summary: Upload competition submission file
operationId: CompetitionsSubmissionsUpload
produces:
- application/json
consumes:
- multipart/form-data
parameters:
- in: formData
name: file
required: true
type: file
description: Competition submission file
- in: path
name: guid
required: true
type: string
description: Location where submission should be uploaded
- in: path
name: contentLength
required: true
type: integer
description: Content length of file in bytes
- in: path
name: lastModifiedDateUtc
required: true
type: integer
description: Last modified date of file in milliseconds since epoch in UTC
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/submissions/submit/{id}:
post:
tags:
- kaggle
summary: Submit to competition
operationId: CompetitionsSubmissionsSubmit
produces:
- application/json
consumes:
- multipart/form-data
parameters:
- in: formData
name: blobFileTokens
required: true
type: string
description: Token identifying location of uploaded submission file
- in: formData
name: submissionDescription
required: true
type: string
description: Description of competition submission
- in: path
name: id
required: true
type: string
description: Competition name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/data/list/{id}:
get:
tags:
- kaggle
summary: List competition data files
operationId: CompetitionsDataListFiles
produces:
- application/json
parameters:
- in: path
name: id
required: true
type: string
description: Competition name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/data/download/{id}/{fileName}:
get:
tags:
- kaggle
summary: Download competition data file
operationId: CompetitionsDataDownloadFile
parameters:
- in: path
name: id
required: true
type: string
description: Competition name
- in: path
name: fileName
required: true
type: string
description: Competition name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/data/download-all/{id}:
get:
tags:
- kaggle
summary: Download all competition data files
operationId: CompetitionsDataDownloadFiles
parameters:
- in: path
name: id
required: true
type: string
description: Competition name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/{id}/leaderboard/download:
get:
tags:
- kaggle
summary: Download competition leaderboard
operationId: CompetitionDownloadLeaderboard
parameters:
- in: path
name: id
required: true
type: string
description: Competition name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/competitions/{id}/leaderboard/view:
get:
tags:
- kaggle
summary: VIew competition leaderboard
operationId: CompetitionViewLeaderboard
parameters:
- in: path
name: id
required: true
type: string
description: Competition name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/list:
get:
tags:
- kaggle
summary: List datasets
operationId: DatasetsList
produces:
- application/json
parameters:
- in: query
name: group
type: string
enum: [public, my, myPrivate, upvoted, user]
default: public
description: Display datasets by a particular group
- in: query
name: sortBy
type: string
enum: [hottest, votes, updated, active]
default: hottest
description: Sort the results
- in: query
name: size
type: string
enum: []
default: all
description: (DEPRECATED). Please use --max-size and --min-size to filter dataset sizes.
- in: query
name: filetype
type: string
enum: [all, csv, sqlite, json, bigQuery]
default: all
description: Display datasets of a specific file type
- in: query
name: license
type: string
enum: [all, cc, gpl, odb, other]
default: all
description: Display datasets with a specific license
- in: query
name: tagids
type: string
description: A comma separated list of tags to filter by
- in: query
name: search
default: ''
type: string
description: Search terms
- in: query
name: user
type: string
description: Display datasets by a specific user or organization
- in: query
name: page
type: integer
default: 1
description: Page number
- in: query
name: maxSize
type: integer
format: int64
description: Max Dataset Size (bytes)
- in: query
name: minSize
type: integer
format: int64
description: Max Dataset Size (bytes)
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/list/{ownerSlug}/{datasetSlug}:
get:
tags:
- kaggle
summary: List dataset files
operationId: DatasetsListFiles
produces:
- application/json
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/status/{ownerSlug}/{datasetSlug}:
get:
tags:
- kaggle
summary: Get dataset creation status
operationId: DatasetsStatus
produces:
- application/json
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/view/{ownerSlug}/{datasetSlug}:
get:
tags:
- kaggle
summary: Show details about a dataset
operationId: DatasetsView
produces:
- application/json
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/download/{ownerSlug}/{datasetSlug}:
get:
tags:
- kaggle
summary: Download dataset file
operationId: DatasetsDownload
produces:
- file
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
- in: query
name: datasetVersionNumber
required: false
type: string
description: Dataset version number
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/download/{ownerSlug}/{datasetSlug}/{fileName}:
get:
tags:
- kaggle
summary: Download dataset file
operationId: DatasetsDownloadFile
produces:
- file
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
- in: path
name: fileName
required: true
type: string
description: File name
- in: query
name: datasetVersionNumber
required: false
type: string
description: Dataset version number
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/upload/file/{contentLength}/{lastModifiedDateUtc}:
post:
tags:
- kaggle
summary: Get URL and token to start uploading a data file
operationId: DatasetsUploadFile
produces:
- application/json
consumes:
- multipart/form-data
parameters:
- in: formData
name: fileName
required: true
type: string
description: Dataset file name
- in: path
name: contentLength
required: true
type: integer
description: Content length of file in bytes
- in: path
name: lastModifiedDateUtc
required: true
type: integer
description: Last modified date of file in milliseconds since epoch in UTC
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/create/version/{id}:
post:
tags:
- kaggle
summary: Create a new dataset version by id
operationId: DatasetsCreateVersionById
produces:
- application/json
consumes:
- application/json
parameters:
- in: path
name: id
required: true
type: integer
description: Dataset ID
- in: body
name: datasetNewVersionRequest
required: true
schema:
$ref: '#/definitions/DatasetNewVersionRequest'
description: Information for creating a new dataset version
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/create/version/{ownerSlug}/{datasetSlug}:
post:
tags:
- kaggle
summary: Create a new dataset version
operationId: DatasetsCreateVersion
produces:
- application/json
consumes:
- application/json
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
- in: body
name: datasetNewVersionRequest
required: true
schema:
$ref: '#/definitions/DatasetNewVersionRequest'
description: Information for creating a new dataset version
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/create/new:
post:
tags:
- kaggle
summary: Create a new dataset
operationId: DatasetsCreateNew
produces:
- application/json
consumes:
- application/json
parameters:
- in: body
name: datasetNewRequest
required: true
schema:
$ref: '#/definitions/DatasetNewRequest'
description: Information for creating a new dataset
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/kernels/list:
get:
tags:
- kaggle
summary: List kernels
operationId: KernelsList
produces:
- application/json
parameters:
- in: query
name: page
type: integer
default: 1
description: Page number
- in: query
name: pageSize
type: integer
default: 20
description: Page size
- in: query
name: search
default: ''
type: string
description: Search terms
- in: query
name: group
type: string
enum: [everyone, profile, upvoted]
default: everyone
description: Display only your kernels
- in: query
name: user
type: string
description: Display kernels by a particular group
- in: query
name: language
type: string
enum: [all, python, r, sqlite, julia]
default: all
description: Display kernels in a specific language
- in: query
name: kernelType
type: string
enum: [all, script, notebook]
default: all
description: Display kernels of a specific type
- in: query
name: outputType
type: string
enum: [all, visualization, data]
default: all
description: Display kernels with a specific output type
- in: query
name: sortBy
type: string
enum: [hotness, commentCount, dateCreated, dateRun, scoreAscending, scoreDescending, viewCount, voteCount, relevance]
default: hotness
description: Sort the results. 'relevance' only works if there is a search query
- in: query
name: dataset
type: string
description: Display kernels using the specified dataset
- in: query
name: competition
type: string
description: Display kernels using the specified competition
- in: query
name: parentKernel
type: string
description: Display kernels that have forked the specified kernel
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/kernels/push:
post:
tags:
- kaggle
summary: Push a new kernel version. Can be used to create a new kernel and update an existing one.
operationId: KernelPush
produces:
- application/json
consumes:
- application/json
parameters:
- in: body
name: kernelPushRequest
required: true
schema:
$ref: '#/definitions/KernelPushRequest'
description: Information for pushing a new kernel version
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/kernels/pull:
get:
tags:
- kaggle
summary: Pull the latest code from a kernel
operationId: KernelPull
produces:
- application/json
parameters:
- in: query
name: userName
required: true
type: string
description: Kernel owner
- in: query
name: kernelSlug
required: true
type: string
description: Kernel name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/kernels/output:
get:
tags:
- kaggle
summary: Download the latest output from a kernel
operationId: KernelOutput
produces:
- application/json
parameters:
- in: query
name: userName
required: true
type: string
description: Kernel owner
- in: query
name: kernelSlug
required: true
type: string
description: Kernel name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/kernels/status:
get:
tags:
- kaggle
summary: Get the status of the latest kernel version
operationId: KernelStatus
produces:
- application/json
parameters:
- in: query
name: userName
required: true
type: string
description: Kernel owner
- in: query
name: kernelSlug
required: true
type: string
description: Kernel name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/metadata/{ownerSlug}/{datasetSlug}:
get:
tags:
- kaggle
summary: Get the metadata for a dataset
operationId: MetadataGet
produces:
- application/json
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
post:
tags:
- kaggle
summary: Update the metadata for a dataset
operationId: MetadataPost
consumes:
- application/json
produces:
- application/json
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
- in: body
name: settings
required: true
description: Dataset metadata to update
type: object
schema:
$ref: '#/definitions/DatasetUpdateSettingsRequest'
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
definitions:
Result:
type: object
Error:
type: object
properties:
code:
type: integer
example: 404
description: The server error code returned
message:
type: string
example: NotFound
description: The error message generated by the server
DatasetColumn:
type: object
properties:
order:
type: number
description: The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.)
name:
type: string
description: The column name
type:
type: string
description: The type of all of the fields in the column. Please see the data types on https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata
originalType:
type: string
description: Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `"integer"` would convert to a `type` of `"numeric"`
description:
type: string
description: The description of the column
DatasetUploadFile:
type: object
properties:
token:
type: string
description: A token referencing a specific file upload that can be used across requests
description:
type: string
description: The file description
columns:
type: array
description: A list of dataset column metadata
items:
$ref: '#/definitions/DatasetColumn'
DatasetNewVersionRequest:
type: object
required:
- versionNotes
- files
properties:
versionNotes:
type: string
description: The version notes for the new dataset version
subtitle:
type: string
description: The subtitle to set on the dataset
description:
type: string
description: The description to set on the dataset
files:
type: array
description: A list of files that should be associated with the dataset
items:
$ref: '#/definitions/DatasetUploadFile'
convertToCsv:
type: boolean
description: Whether or not a tabular dataset should be converted to csv
default: true
categoryIds:
type: array
description: A list of tag IDs to associated with the dataset
items:
type: string
deleteOldVersions:
type: boolean
description: Whether or not all previous versions of the dataset should be deleted upon creating the new version
default: false
DatasetNewRequest:
type: object
required:
- title
- licenseShortName
- files
properties:
title:
type: string
description: The title of the new dataset
slug:
type: string
description: The slug that the dataset should be created with
ownerSlug:
type: string
description: The owner's username
licenseName:
type: string
description: The license that should be associated with the dataset
default: unknown
enum:
- CC0-1.0
- CC-BY-SA-4.0
- GPL-2.0
- ODbL-1.0
- CC-BY-NC-SA-4.0
- unknown
- DbCL-1.0
- CC-BY-SA-3.0
- copyright-authors
- other
- reddit-api
- world-bank
subtitle:
type: string
description: The subtitle to be set on the dataset
description:
type: string
description: The description to be set on the dataset
default: ''
files:
type: array
description: A list of files that should be associated with the dataset
items:
$ref: '#/definitions/DatasetUploadFile'
isPrivate:
type: boolean
description: Whether or not the dataset should be private
default: true
convertToCsv:
type: boolean
description: Whether or not a tabular dataset should be converted to csv
default: true
categoryIds:
type: array
description: A list of tag IDs to associated with the dataset
items:
type: string
KernelPushRequest:
type: object
required:
- text
- language
- kernelType
properties:
id:
type: integer
description: The kernel's ID number. One of `id` and `slug` are required. If both are specified, `id` will be preferred
slug:
type: string
description: The full slug of the kernel to push to, in the format `USERNAME/KERNEL-SLUG`. The kernel slug must be the title lowercased with dashes (`-`) replacing spaces. One of `id` and `slug` are required. If both are specified, `id` will be preferred
newTitle:
type: string
description: The title to be set on the kernel
text:
type: string
description: The kernel's source code
language:
type: string
description: The language that the kernel is written in
enum:
- python
- r
- rmarkdown
kernelType:
type: string
description: The type of kernel. Cannot be changed once the kernel has been created
enum:
- script
- notebook
isPrivate:
type: boolean
description: Whether or not the kernel should be private
enableGpu:
type: boolean
description: Whether or not the kernel should run on a GPU
enableInternet:
type: boolean
description: Whether or not the kernel should be able to access the internet
datasetDataSources:
type: array
description: A list of dataset data sources that the kernel should use. Each dataset is specified as `USERNAME/DATASET-SLUG`
items:
type: string
competitionDataSources:
type: array
description: A list of competition data sources that the kernel should use
items:
type: string
kernelDataSources:
type: array
description: A list of kernel data sources that the kernel should use. Each dataset is specified as `USERNAME/KERNEL-SLUG`
items:
type: string
categoryIds:
type: array
description: A list of tag IDs to associated with the dataset
items:
type: string
DatasetUpdateSettingsRequest:
type: object
required:
properties:
title:
type: string
description: Title of the dataset
subtitle:
type: string
description: Subtitle of the dataset
description:
type: string
description: Decription of the dataset
isPrivate:
type: boolean
description: Whether or not the dataset should be private
licenses:
type: array
description: A list of licenses that apply to this dataset
items:
type: object
schema:
$ref: '!/definitions/License'
keywords:
type: array
description: A list of keywords that apply to this dataset
items:
type: string
collaborators:
type: array
description: A list of collaborators that may read or edit this dataset
items:
type: object
schema:
$ref: '!definitions/Collaborators'
data:
type: array
description: A list containing metadata for each file in the dataset
items:
type: object
License:
type: object
required:
- name
properties:
name:
type: string
description: Name of the license
enum:
- CC0-1.0
- CC-BY-SA-4.0
- GPL-2.0
- ODbL-1.0
- CC-BY-NC-SA-4.0
- unknown
- DbCL-1.0
- CC-BY-SA-3.0
- copyright-authors
- other
- reddit-api
- world-bank
Collaborator:
type: object
required:
- username
- role
properties:
username:
type: string
description: Username of the collaborator
role:
type: string
description: Role of the collaborator
enum:
- reader
- writer
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。