Child pages
  • API Statistics - migrating from JSON web service to API Statistics

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

When doing the migration, the following need to be taken into consideration:

  • There are methods and parameters that are decommissioned. See this chapter for more information.

  • There are differences in the JSON format. See this chapter for more information.

Differences between the 1.1 and 2.1 WDDS versions

Initial modification

One of the main differences between the two versions is the use of positional parameters in 1.1 versus named parameters in 2.1, where the null values are not displayed. An index is provided in version 2.1 to sort the values. Both these modifications help the provision of a faster / filtered response.

Some other modifications that were performed in the initial state:

  • "title" has been renamed to "label" on the root-level

  • “updated” is used instead of “lastUpdateDate”

  • All non-standard properties (datasetID, language, agency, description, status) have been moved inside “extension” section

  • The standard “status” property has been updated to include any metadata information at the observation level

  • The possible values of “class” have been updated to include the “dataset” response instead of “bundle” (“bundle” was an accepted value before version 2.0)

JSON-stat modifications

  • JSON-stat 2.0 support in WDDS:

    • The “version” property has been added with the value “2.0”

    • The “id”, “size” and “role” properties have been moved from the dimension level to the dataset level

  • JSON-stat status property:

    • The “status” property is not displayed in case it contains no information

  • JSON-stat error message change for too voluminous extractions:

    • “Too many categories have been requested. Maximum is 50" error message is displayed in case the extraction to be retrieved is too big. It replaces the previous error message “Maximum 50 datasets can be retrieved at a time” or the response of the query builder “Maximum 50 sub-indicators can be retrieved at a time. Please filter your selection”

  • JSON-stat error specification:

    • the communicated error message is in JSON format instead of plain text. The error elements are:

      • status: The HTTP status code

      • id: The provider’s internal error code (optional)

      • href: A link to a web page where information about this error is published (optional)

      • label: A short descriptive text about the error

Example:

{ "error": [\{"status": 400,"id": 100,"label": "NO_RESULTS: No data found"}]}
  • JSON-stat HREF element contains all parameters:

    • The HREF property at the root contains the URL of the request

  • JSON-stat “updated” property contains a date instead of timestamp:

    • if no time is specified, the value of "updated” should contain a date and not a timestamp with 0 values set for time

  • JSON-stat “source” value is “Eurostat”, instead of “ESTAT”.

Methods, parameters and elements to be decommissioned in API Statistics

The table below are lists the methods, parameters and elements that will be decommissioned in API Statistics:

target

method


filterNonGeo

method


getRegionalCategorization

method

The "geo_categorical" parameter is used for the UNICODE which won’t be supported anymore.

getCountryLabel

method

The "country_label" parameter is used for the UNICODE which won’t be supported anymore.

callBack

method

callBack is replaced by CORS.

precision

parameter

The "precision" parameter is used for the UNICODE which won’t be supported anymore.

shortLabel

parameter


groupedIndicators

parameter


unitLabel

parameter


HREF

Response JSON-stat element

Not used.

The methods and parameters that will be carried on to the API Statistics are:

  • lastTimePeriod

  • sinceTimePeriod

  • untilTimePeriod

  • geoLevel, can be multiple and available values are:

    • aggregate: European aggregates based on a white list - EU15, EU25, EU27_2007, EU27_2019, EU28, EA19, etc.
    • country: any country code (EU Member States, or EFTA, or Candidate Countries or other countries) - any 2 digits - i.e. FR

    • nuts1: NUTS code level 1 - any 3 digits - i.e. FR4 (see this page for more information about NUTS classification)

    • nuts2: NUTS code level 2 - any 4 digits - i.e. FR41 (see this page for more information about NUTS classification)

    • nuts3: NUTS code level 3 - any 5 digits - i.e. FR413 (see this page for more information about NUTS classification)

    • city: code at city level - any 7 digits - i.e. DE_DEL1 (Karlsruhe)

Differences between WDDS 2.1 JSON and API Statistics JSON

Differences in TIME_PERIOD values

Difference type

WDDS 2.1 JSON


API Statistics JSON



Change in data Time period code

Pattern

Example

Pattern

Example

Comment

5 years

YYYY

2019

YYYY

2019

The indicated year is the last one of the 5 years period.

Year

YYYY

2019

YYYY

2019


Semester

YYYYSN

2015S1

YYYY-SN

2015-S1


Quarter

YYYYQN

2015Q4

YYYY-QN

2015-Q4


Month

YYYYMNN

2015M02

YYYY-MM

2015-02


Week

YYYYWNN

2020W28

YYYY-WNN

2020-W28


Day

YYYYMNNDNN

2019M06D13

YYYY-MM-DD

2015-12-31


Differences in fields

  • The field order:

WDDS 2.1

JSON-stat

API Statistics

JSON-stat

1.version

2.label

3.href

4.source

5.updated

6.status

7.extension

8.class

9.value

10.dimension

11.id

12.size

1.version

2.class

3.label

4.source

5.updated

6.value

7.status

8.id

9.size

10.dimension

11.extension



  • “source” property value:

WDDS 2.1

JSON-stat

API Statistics

JSON-stat

Eurostat

ESTAT


  • “updated” property format:

WDDS 2.1

JSON-stat

API Statistics

JSON-stat

YYYY-MM-DD

yyyy-MM-ddTHH:mm:ssZ


  • “extension” field:

WDDS 2.1

JSON-stat

API Statistics

JSON-stat

"datasetId" property name

“id” property name

“description” property is present

“description” property is not present

“subTitle” property is present

“subTitle” property is moved into the section “annotation” – see below.

“annotation” is not present

“annotation” is present and it contains the following extra fields:

DISSEMINATION_OBJECT_TYPE

OBS_COUNT

OBS_PERIOD_OVERALL_OLDEST

OBS_PERIOD_OVERALL_LATEST

UPDATE_STRUCTURE

UPDATE_DATA

SUBTITLE

SOURCE_INSTITUTIONS

DISSEMINATION_PRESENTATIONS

Combinations of flags are not present

Combinations of flags are present


  • “dimension” field:

WDDS 2.1

JSON-stat

API Statistics

JSON-stat

"freq" dimension is not present

"freq" dimension is present

"label" property contains the dimension code

"label" property contains the dimension title


  • “id” field:

WDDS 2.1

JSON-stat

API Statistics

JSON-stat

"freq" is not present

"freq" is present


  • “size” field:

WDDS 2.1

JSON-stat

API Statistics

JSON-stat

"size" field does not include the "freq" dimension

"size" field includes the "freq" dimension

  • No labels
_