OpenData Bratislava API API Reference

API Documentation for OpenData Bratislava API

API Endpoint
http://opendata.bratislava.sk/api
Version: 1.0.0

Authentication

ApiKeyAuth

type
apiKey
in
header
name
key

Category

List of categories

GET /api/category

Returns array of categories

locale: string sk, en sk
in header

Language (sk/en)

200 OK

Array of available categories

type
Response Example (200 OK)
{
  "id": 12,
  "name": "Doprava",
  "slug": "doprava"
}

Category informations

GET /api/category/{ id }

Returns informations about specified category

id: integer
in path

Category ID

locale: string sk, en sk
in header

Language (sk/en)

200 OK

Array of category informations

type
400 Bad Request

Invalid parameter - id

404 Not Found

Category doesn't exists

Response Example (200 OK)
{
  "id": 12,
  "name": "Doprava",
  "slug": "doprava"
}

List of datasets in category

GET /api/category/{ id }/datasets

Returns array of datasets per page

id: integer
in path

Category ID

locale: string sk, en sk
in header

Language (sk/en)

200 OK

Array of available datasets in category

400 Bad Request

Invalid parameter - id

404 Not Found

Category doesn't exists

Response Example (200 OK)
{
  "id": 123,
  "name": "Dataset",
  "slug": "dataset"
}

Dataset

List of datasets

GET /api/dataset

Returns array of datasets per page

id: integer
in header

Page number

locale: string sk, en sk
in header

Language (sk/en)

200 OK

Array of available datasets

400 Bad Request

Invalid header - page

404 Not Found

Page not found

Response Example (200 OK)
{
  "id": 123,
  "name": "Dataset",
  "slug": "dataset"
}

Dataset informations

GET /api/dataset/{ id }

Returns informations about specified dataset

id: integer
in path

Dataset ID

locale: string sk, en sk
in header

Language (sk/en)

200 OK

Array of dataset informations

400 Bad Request

Invalid parameter - id

404 Not Found

File or dataset doesn't exists

Response Example (200 OK)
{
  "id": 123,
  "name": "Dataset",
  "slug": "dataset",
  "description": "Description of dataset",
  "author": "Author",
  "created_at": 1588593600,
  "changed_at": 1588593600,
  "licence": "Creative commons",
  "category": 123,
  "year": 2020,
  "disctrict": "Bratislava - Stare mesto",
  "uniq_id": "abcde12345",
  "downloaded": 12345,
  "powerbi": null,
  "map": null,
  "onlinedata": false,
  "tags": "bratislava stare mesto"
}

List of files in dataset

GET /api/dataset/{ id }/files

Returns array of files in specified dataset

id: integer
in path

Dataset ID

locale: string sk, en sk
in header

Language (sk/en)

200 OK

Array of files in dataset

type
400 Bad Request

Invalid parameter - id

404 Not Found

Dataset doesn't exists

Response Example (200 OK)
{
  "id": 123,
  "name": "File name",
  "type": "csv"
}

File

File informations

GET /api/file/{ id }

Returns informations about specified file

id: integer
in path

File ID

locale: string sk, en sk
in header

Language (sk/en)

200 OK

Array of file informations

400 Bad Request

Invalid parameter - id

404 Not Found

File or dataset doesn't exists

Response Example (200 OK)
{
  "id": 123,
  "dataset": 123,
  "name": "File name",
  "type": "csv",
  "created_at": "2020-05-04 12:00:00",
  "powerbi": null,
  "map": null
}

Download file

GET /api/file/{ id }/download

Returns specified file

id: integer
in path

File ID

200 OK

Specified file

400 Bad Request

Invalid parameter - id

404 Not Found

File or dataset doesn't exists

Schema Definitions

Category: object

id: integer
name: string
slug: string
Example
{
  "id": "integer",
  "name": "string",
  "slug": "string"
}

Dataset-basic: object

id: integer
name: string
slug: string
Example
{
  "id": "integer",
  "name": "string",
  "slug": "string"
}

Dataset: object

id: integer
name: string
slug: string
description: string
author: string
created_at: string
changed_at: string
licence: string
category: integer
year: integer
disctrict: string
uniq_id: string
downloaded: integer
powerbi: string
map: string
onlinedata: boolean
tags: array of strings
Example
{
  "id": "integer",
  "name": "string",
  "slug": "string",
  "description": "string",
  "author": "string",
  "created_at": "string",
  "changed_at": "string",
  "licence": "string",
  "category": "integer",
  "year": "integer",
  "disctrict": "string",
  "uniq_id": "string",
  "downloaded": "integer",
  "powerbi": "string",
  "map": "string",
  "onlinedata": "boolean",
  "tags": "array of strings"
}

File-basic: object

id: integer
name: string
type: string
Example
{
  "id": "integer",
  "name": "string",
  "type": "string"
}

File: object

id: integer
dataset: integer
name: string
type: string
created_at: string (date-time)
powerbi: string
map: string
Example
{
  "id": "integer",
  "dataset": "integer",
  "name": "string",
  "type": "string",
  "created_at": "string (date-time)",
  "powerbi": "string",
  "map": "string"
}