# Pacific Data Hub

Harnessing the power of data and knowledge for sustainable development

The **Pacific Data Hub (PDH**) aims to deliver the most comprehensive collection of data and information about the Pacific and for the Pacific, including key areas such as population statistics, fisheries science, climate change adaptation, disaster risk reduction and resilience, public health surveillance, conservation of plant genetic resources for food security, and human rights.

The Pacific Data Hub is an innovative programme of work, led by the [Pacific Community (SPC)](https://spc.int/) and supported by the [New Zealand Ministry of Foreign Affairs and Trade](https://www.mfat.govt.nz/en/about-us/mfat-annual-reports/mfat-annual-report-2020-21/pacific-data-hub-launched/). It is a regional public good that provides a single authoritative point of entry for data about the Pacific and serves as a vehicle for investment in a sustainable regional data infrastructure.

We have built the Pacific Data Hub platform on our intimate understanding of the Pacific region and the enduring relationships we have forged with our members. We understand the policy and development challenges that matter to our members, and we work in coordination with our development partners to provide access to timely and reliable data to inform better policy development and decision-making to help deliver better development outcomes for the Pacific region.

## A Pacific Data Ecosystem

The Pacific Data Hub is part of an emerging Pacific Data Ecosystem, a partnership between Pacific Island Countries and Territories, [SPC](https://www.spc.int/) and the [Secretariat of the Pacific Regional Environment Programme (SPREP)](https://www.sprep.org/) to promote greater coordination in data management, dissemination and uptake initiatives. Check out the [Pacific Environment Portal](https://pacific-data.sprep.org/) for more data.

## Key Components

The Pacific Data Hub platform is made up of four key components:

1. [Data Catalogue](/catalogue)
2. [PacificMap](/pacific-map)
3. [PDH.stat](/dotstat)
4. [Microdata Library](/ml)

|                                                                                                                                                                                                                                                                                       |                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p></p><p><img src="https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKdcC3RA1N6FNk_xHvU%2F-MKdixTs6PEMSyJZa-sx%2FPDH%20catalogue%20thumb%20250x163.png?alt=media&amp;token=ee9c5f2b-47e0-4808-b1d9-e995fff77c43" alt=""></p> | [**Data Catalogue**](/catalogue) - an open data repository which manages and publishes all data in the Pacific Data Hub.  It is the central component which links to **PDH.stat** and the **Microdata Library**; Most spatial datasets in the Data Catalogue can be visualised with **PacificMap** |
| ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKdcC3RA1N6FNk_xHvU%2F-MKdj4EDTXfjzySnGzI1%2FPacificMap%20thumb%20250x163.png?alt=media\&token=6f1df97c-43c1-4c8c-9d94-94c3861931f8)                                     | [**PacificMap**](/pacific-map) - a geospatial data exploration tool providing easy-to-use map-based visualisation of spatial data;                                                                                                                                                                 |
| ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKdcC3RA1N6FNk_xHvU%2F-MKdj9fzeF85xDgnHOBq%2FDotstat%20thumb%20250x163.png?alt=media\&token=2522fb6b-c70b-41da-b395-f1a010c03907)                                        | [**PDH.stat** ](/dotstat)- indicator database explorer which contains the 132 Pacific Sustainable Development Indicators (SDGs) as well as a range of economic, health, demographic and environmental datasets (replaces National Minimum Development Indicator Database - NMDI)                   |
| ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKdcC3RA1N6FNk_xHvU%2F-MKdjF03Ngr5NW4O2rk-%2FMicrodata%20library%20thumb%20250x163.png?alt=media\&token=7d60845c-dfb5-41cb-9d23-ad46a2b0c772)                            | [**Microdata Library** ](/ml)- online census and survey documentation and archiving application which also provides access to microdata for some collections.                                                                                                                                      |


# Change Log

### Version 3.5.0 - Released on 2024-07-17

#### PDH CKAN Catalogue

* New topics (thematic areas) for datasets
* Unique dataset metadata schema
* Data migration

### Version 3.4.2 - Released on 2023-06-09

#### PDH Portal

* New dashboards added
* Linking to PCCOS catalogue

#### Microdata Library ([link](https://microdata.pacificdata.org))

* Updated NADA to version 5.2.1

### Version 3.4.1 - Released on 2023-02-23

#### PDH Portal

* Added more dashboards (powerBI based)
* Improved Maritime Boundaries dashboard
* Improved stories and news section
* Better topic pages
* Sitemaps

#### PDH CKAN Catalogue

* CKAN version 2.9.7
* Better support for geospatial data files
* New "video" dataset type
* Added JSON-LD support
* Fixed organization and group lists
* Miscellaneous fixes

### Version 3.0 - Released on 2022-02-15

#### PDH Portal

* New interactive country map
* Improved page layouts (headers and breadcrumbs)
* Improved mobile version
* Page footer fixes

#### PDH CKAN Catalogue

* CKAN version 2.9.3
* Improved search results and suggestions
* Merged *datasets* and *publications* schemas definitions (PDH-DCAT)
  * Metadata field *Theme* now contains Library of Congress Subject headings
  * Metadata field *Countries* separated in *Countries* and *Regions* fields
* Fixed packages without topics
* Fixed broken harvesters
* Added Citations (DataCite) and Plumx altmetrics support
* Improved user tour (in-page tutorial)


# Data Catalogue

Data from the Pacific, for the Pacific, all in a single place.

### What is the Data Catalogue?

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKbG8eOWHh60Bdd7bfa%2F-MKbqffb6bOD_xHdRxBG%2FPDH%20catalogue%20main%20search.png?alt=media\&token=5df8a8dd-9595-4688-9674-bf76308de2c8)

The Data Catalogue is at the centre of the Pacific Data Hub. It is an open data repository which manages and publishes all data in the Pacific Data Hub. Data comes from a range of sources, though is always related to the Pacific Region, and is accessible via a powerful search engine (above).

The Data Catalogue publishes data in units called "datasets". A dataset is a parcel of data - for example, it could be the education statistics for a country, the Exclusive Economic Zones (EEZ's) for the Pacific, or temperature readings from various weather stations. When users search for data, the search results they see will be individual datasets:&#x20;

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKbG8eOWHh60Bdd7bfa%2F-MKbqkIiTmaIAmjYXkHX%2FPDH%20catalogue%20main%20search2.png?alt=media\&token=d6caf5e3-8e3a-4609-97fb-2d1d42730015)

Each dataset contains two main elements:

* Information or "metadata" about the data. For example, the title and publisher, date, what formats it is available in, what license it is released under, etc.
* A number of "resources", which hold the data itself. A resource can be a CSV or Excel spreadsheet, XML file, PDF document, image file, KML, GeoJSON, etc. A dataset can contain any number of resources. For example, different resources might contain the data for different years, or they might contain the same data in different formats.&#x20;


# User Guide

For an introduction on how to use the Data Catalogue see this video:

{% embed url="<https://youtu.be/H1KBLkZUR2s>" %}

### How to get started with the Data Catalogue

Go to the Pacific Data Hub home page <https://pacificdata.org/>

You will be redirected to the Data Catalogue when you make your data search either using the **Search bar** or the **Shortcuts** located below.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKb6SSXXODRbzH6vl_n%2F-MKb7y0tlNAE-SO34QvT%2Fimage.png?alt=media\&token=7c6cd5d1-e3d9-47f4-88b3-2f13970d6efa)

### Search data

In this example we have typed "cyclone" in the search bar and redirected to the Data Catalogue

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKb7zUvKou1NOvN6h2n%2F-MKb8zIp3Kzi9Okjhh_h%2Fimage.png?alt=media\&token=e7085d48-5fe3-453a-88db-dc642f8ebf94)

We can order our results by relevance, popularity, name or last modification using the **Order by** button

To narrow down the data search we can use the filtering tools located on the left. The filters available are **Topic, Member countries, Organisations, Tags, Formats, Dataset type and Licenses.**

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKb7zUvKou1NOvN6h2n%2F-MKbAhcCowzj6_wavqNQ%2Fimage.png?alt=media\&token=b442846a-82e2-46c7-a3ba-b27e5a1bfb78)

### Explore inside the dataset

Once you have found the dataset you are looking for, click on it to open the Dataset screen.

* On top of the screen you will find the dataset's title and description.&#x20;
* You can export the metadata by clicking on the **Export Metadata** button located below the description.
* Metadata can be accessed on the bottom of the page.
* A number of different data resources with various formats can be linked to the dataset.&#x20;
* Click on the resources to access the resource page where you will find the description, a preview pane and a download link.
* Different preview screens are available depending on the format of the file.&#x20;

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKb7zUvKou1NOvN6h2n%2F-MKbDApdv1Gk6SKcjCm9%2Fimage.png?alt=media\&token=93dc2d30-805e-4fd0-823a-29cc2aed47ce)

* At the bottom of the file you will find shortcuts to access the other resources linked to the dataset.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKb7zUvKou1NOvN6h2n%2F-MKbFwxck9hbEE_fYlfz%2Fimage.png?alt=media\&token=bd7d9bca-4ad9-42d1-9be8-ad732a54ae48)


# Creating a new account

If you would like to add or edit datasets, view private datasets and download restricted resources from the PDH Catalogue, you will need to sign in with a PDH user account.  Follow the steps below to register for a new account.

{% hint style="info" %}
For SPC staff, please sign in using the [Okta link](https://pacificdata.org/saml/drupal_login/spc_okta).
{% endhint %}

| From the Home page, click on the [**Login** ](https://pacificdata.org/user/login)link                                                                                                                                                                                                                                                            | ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDSpD50SdXxsYnU7P9D%2Fuploads%2F3PBWiZHhgBwLZZQCGmzg%2Fimage.png?alt=media\&token=d865e73c-2408-46b2-8cbf-6ed8d3d34d34) |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Click on the [**Create account**](https://pacificdata/org/user/register) tab                                                                                                                                                                                                                                                                     | ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDSpD50SdXxsYnU7P9D%2Fuploads%2FsnEnBATsND48TFWDSaiL%2Fimage.png?alt=media\&token=3c8424a0-4af2-41b8-9ef9-a558cd488ba9) |
| <p>Please enter a username, email address and password.</p><p></p><p>Then click on the 'I'm not a robot' check box. You may be asked to complete the verification process.</p><p></p><p>Follow the verification steps then click on the <mark style="color:blue;background-color:blue;"><strong>'Create new account'</strong></mark> button.</p> | ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDSpD50SdXxsYnU7P9D%2Fuploads%2F9GwZCRTVraQM7nWcrrFb%2Fimage.png?alt=media\&token=fdad4d43-fdf9-4356-aaba-5375f44de91d) |
| <p>Once you have successfully registered, you will be redirected to the Home page where you will see the following notification message at the center of the page:</p><p></p><p><mark style="color:green;background-color:yellow;"><strong>'Registration successful. You are now logged in.'</strong></mark></p>                                 | ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDSpD50SdXxsYnU7P9D%2Fuploads%2FoGoRQBFws9BxuoOdmAek%2Fimage.png?alt=media\&token=ad01adf5-310f-4993-b0b2-2ff1b6bf5a7b) |
| You may now browse the catalogue as a registered user. Click on the [**Data Catalogue** ](https://pacificdata.org/data)link from the top navigation menu.                                                                                                                                                                                        | ![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDSpD50SdXxsYnU7P9D%2Fuploads%2FSTmNMZqYKhoxaxVQoUmO%2Fimage.png?alt=media\&token=7838a409-f6bd-4138-9c8b-aa325fdbf657) |

{% hint style="info" %}
If you wish to upload or modify datasets within the [Data Catalogue](https://pacificdata.org/data), you will need to be granted permissions to an [organisation](https://pacificdata.org/data/organization) within the catalogue. Please get in touch with the owner of the [organisation ](https://pacificdata.org/data/organization)you wish to contribute to.

You can also contact the PDH administrators on live chat or on the email <pdh-support@spc.int>.
{% endhint %}


# Advanced Search

Using the advanced search features on the PDH Data Catalogue.

## Use the advanced search

{% hint style="info" %}
Check the 'Advanced search' under the search bar to enable additional search filters and operators.
{% endhint %}

![Enabling advanced search to access additional search filters and operators.](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-Mc4YvT4F-w7Ggezl-FA%2F-Mc4ZeWT-gmudOJLyuOV%2Fimage.png?alt=media\&token=89f2d86b-471f-4e8c-82a3-7a95185f1149)


# Solr Search Queries

Searching for data using Solr search syntax

By enabling the advanced search feature, you can take advantage of Solr's flexible search syntax to analyze your data. For example, you can search for data that contains the terms 'Climate' and 'Financing' in close proximity to each other, or search for data or dates that fall within a specific range.

{% hint style="info" %}
You can add Solr search queries by enabling 'Advanced search' under the search bar, then checking the 'Add query syntax to search' check box.
{% endhint %}

![Enbaling advanced search](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-Mc4Rp7Io0J2BAwYWfnH%2F-Mc4UINscpX8RvB2mM-7%2Fimage.png?alt=media\&token=5619d53c-0773-4212-9ecc-beb19e718852)

![Enabling Solr search](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-Mc4Rp7Io0J2BAwYWfnH%2F-Mc4UCdlH3Lz4bRE44yH%2Fimage.png?alt=media\&token=a91ffd7f-698a-4b91-8c5c-80b3a4251edc)

### Searching for keywords and search phrases

The following are examples of searches for a specific keyword or search phrase.

| Task                                                                                                      | Example                                                                                                                                 | Syntax                                                                     |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| Search for a keyword in a specific field                                                                  | Search for the keyword `AccessLog` in the title field                                                                                   | `title:AccessLog`                                                          |
| Search for a phrase in a specific field                                                                   | Search for the phrase `Code 1918` in the title field                                                                                    | `title:"Code 1918"`                                                        |
| Search for a phrase in one field and a second phrase in another field                                     | Search for `Error 401` in the title field and `Authorization is denied` in the body field                                               | `title:"Error 401" AND body:"Authorization is denied"`                     |
| Combine searches for multiple phrases or keywords using operators such as AND or OR                       | Search for `Error 401` in the title field AND `Authorization is denied` in the body field, or search for `Password` in the title field. | `(title:"Error 401" AND body:"Authorization is denied") OR title:Password` |
| Search for a keyword in a specific field, excluding search results with another keyword in the same field | Search for `401` but not `404` in the title field                                                                                       | `title:401 -title:404`                                                     |
| Search for data in which a field does not contain a specific value                                        | Search for data where the inStock field is not false                                                                                    | `-inStock:false`                                                           |
| Search for values in a specified range                                                                    | Search for values from `20020101` to `20030101` in the mod\_date field                                                                  | `mod_date:[20020101 TO 20030101]`                                          |

### Searching using wildcards

You can use the wildcard character (\*) to search for results that are not exact matches. Solr search syntax does not support using a wildcard symbol as the first character of a search.

| Task                                                                                     | Example                                                                         | Syntax              |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------- |
| Search for words starting with a string of characters                                    | Search for any word that starts with `En` in the title field                    | `title:En*`         |
| Search for words starting and ending with specific strings of characters                 | Search for any word that starts with `En` and ends with `ed` in the title field | `title:En*ed`       |
| Search for values in a field that are less than or equal to a specified numeric value    | Search for values in the code field that are less than or equal to 100          | `code:[* TO 100]`   |
| Search for values in a field that are greater than or equal to a specified numeric value | Search for values in the code field that are greater than or equal to 100       | `code:[100 TO *]`   |
| Search for data that contains a specific field                                           | Find data that includes the message field                                       | `message:[* TO *]`  |
| Search for data that does not contain a specific field                                   | Find data that does not have a message field                                    | `-message:[* TO *]` |

#### Searching using additional search options

You can search for terms that are a given number of words away from each other (called a proximity search).

| Task                                                                         | Example                                                  | Syntax             |
| ---------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------ |
| Search for keywords that are a specific number of words away from each other | Search for `log analysis` within 4 words from each other | `"log analysis"~4` |
| Search for transposed words                                                  | Search for `log analysis` or `analysis log`              | `"log analysis"~1` |

You can approximate a search for multiple keywords (for example, a search for business AND analysis) using a search with a large proximity value, such as `"business analysis"~10000000`. For practical purposes, this returns the same group of results as searching for business AND analysis. Unlike a search for business AND analysis, however, results in which business and analysis are closer together are regarded as having a higher search relevance. However, the proximity search also requires more time and system resources to perform.

You can determine which parts of a search query are treated as more important by providing a numeric boost factor. For example, the following query assigns higher importance to matches in the title field than matches in the body field: `(title:MicroStrategy OR title:Analytics)^1.5 (body:Intelligence OR body:Server)`.

For a detailed overview of Solr query syntax, including information about creating queries that take advantage of functions, nested queries, boost factors, and more, see the [official documentation for the query parser syntax](http://lucene.apache.org/java/3_5_0/queryparsersyntax.html). In most cases, Solr uses the standard Lucene query syntax to perform searches. For a list of exceptions, see the [Solr wiki](http://wiki.apache.org/solr/SolrQuerySyntax).


# API

The PDH Data Catalogue is built on [CKAN](https://ckan.org/), the world's leading open source data management system. CKAN’s **Action API** is a powerful, RPC-style API that exposes all of CKAN’s core features to API clients.

{% hint style="info" %}
Follow the link below to interact with the PDH Data Catalogue API
{% endhint %}

{% embed url="<http://ckan-api.pacificdata.org/dist/>" %}

This API provides live access to the Pacific Data Hub Data Catalogue. Further documentation on the API is available from [https://docs.ckan.org/en/latest/api/index.html](https://docs.ckan.org/en/latest/api/index.html#).

Confirm the version of the API available from the catalogue by requesting <https://pacificdata.org/data/api/3/action/status_show>.


# PacificMap

A spatial data exploration tool for everyone

[PacificMap ](https://map.pacificdata.org)is a platform developed by [CSIRO Data61](https://data61.csiro.au) and the [Pacific Data Hub (PDH)](https://pacificdata.org) in collaboration with the [Pacific Community (SPC)](https://spc.int), as part of the Asia - Pacific Data for Development Initiative (D4D). The PacificMap is a platform for map-based access to spatial data from 22 Pacific Island Countries and Territories. It aims to lower the barrier and enhance access to timely, relevant and useful data for government and non-government organisations, research and academic institutions, businesses and communities throughout the Pacific.

The platform brings together geospatial datasets from the Pacific Data Hub catalogue sourced from SPC's technical divisions and its member countries. Data is also sourced from a number of development partners and other publically available sources which provide spatial data from the Pacific.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MFhDlTIpt2zLG9-kt-M%2F-MFhK8nCdPI8LHyxBIWF%2Fimage.png?alt=media\&token=9f52174a-981d-48c1-a8fa-538a717ddf86)

Use the interactive features of the PacificMap platform to produce maps and create compelling impact stories. From remote-sensed geospatial to statistical time series data, PacificMap enables the analysis of public and private geospatial data at global, regional, national and subnational data.


# User Guide

For an introduction on how to use Pacific map see this video:

{% embed url="<https://youtu.be/drsCpfCF27M>" %}

### How to get started with PacificMap

* You can access PacificMap either from the Pacific Data Hub main page or by using the URL <https://map.pacificdata.org/>.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKWqKMcO_WmVsZ5FEiK%2F-MKWrD1o1ro6W75LncJe%2Fimage.png?alt=media\&token=9a4b1844-0c6a-4fdb-b00e-3f9e8ced32e1)

* In the left-hand panel click the **Explore map data** button to launch the Data Catalogue.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKX3RY3fMfpaUf_xlQN%2F-MKX97cT45VZqNlDo7cc%2Fimage.png?alt=media\&token=e9dfe09b-c9f4-4814-8763-0e069fab2f8c)

* Browse through the Data Catalogue to find a data set of interest. Click on the title of your preferred data set to get a preview of that data, along with a description and other relevant metadata. To view your selected data set on the main map, click the **Add to the Map** button. The spatial data will be immediately displayed in the map view, and a visual legend for that data will appear in the Data Workbench, located on the left-hand side of the page.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKX9L38AJ4ynuMIR_Cu%2F-MKXBQCQylIy6hWZ4ZzJ%2Fimage.png?alt=media\&token=3f961790-1375-4519-a190-be982257eba1)

* To locate the loaded data on the map, go to the Data Workbench (positioned on the left-hand side of the page), and click the **Ideal Zoom** link for your desired data set. From here you can also click **About data** to get more information about your selected data set.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKX9L38AJ4ynuMIR_Cu%2F-MKXBxi3hjrA3sEnnoeP%2Fimage.png?alt=media\&token=a7d43abf-ed46-498a-add5-48b2d959496a)

* To add additional datasets to the map, simply click **Explore map data** again in the left-hand panel to relaunch the Data Catalogue.
* Zoom manually by moving your mouse pointer over the map and using your mouse wheel to zoom in or out further.
* Click and drag the map to further show the region in which you are interested.
* Click on a feature (that is, directly on a point or line, or within a region) to show data about the individual feature.

### How to find out about a displayed feature

* Click on the feature which is displayed on the map. You can click on points, lines or within regions to see a display of the information available from the spatial data provider for that particular feature.
* For points and lines, you need to click quite accurately to identify the feature. For Regions, clicking on the boundary will give ambiguous results. Click within the region.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXCxZhSFaVe0knZk0r%2F-MKXDnn05lKa20AosB47%2Fimage.png?alt=media\&token=f3ac1a2e-c4a1-4bc8-b4a0-ef98110555ec)

Note: You cannot find out further information about the features which are part of the base maps.

### How to configure map settings

* In the top-right corner click on **Map Settings.**

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXE3y910rjWghzRGNJ%2F-MKXEfTTQsW_9Q6MaVFl%2Fimage.png?alt=media\&token=13c1837a-95bd-4683-bafc-3415c338340d)

* In the **Map View** section you can select whether to display data using **3D Terrain**, **3D Smooth** or **2D.**

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXE3y910rjWghzRGNJ%2F-MKXFL-UFphCamRGS3DM%2Fimage.png?alt=media\&token=dca2bd88-b241-44aa-b358-fb895b213348)

* In the **Base Map** section you can select the most appropriate option for the type of dataset you are working with.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXKTKtVfcI81yAkANC%2F-MKXKkrWwHsXUdcKcpN4%2Fimage.png?alt=media\&token=2ee8e40f-df14-4951-af90-020260474361)

* The **Image Optimisation** slide control will help you to prioritize between quality or performance. In cases where yourcomputer is not powerful enough or the bandwidth is limited, you should move the control to the right in order to make the app faster and more reactive. &#x20;

### How to display my own spreadsheet or spatial data

PacificMap can display two kinds of spreadsheets:

1. Spreadsheets with a **point location (latitude and longitude)** for each row, expressed as two columns: `lat` and `lon`. These will be displayed as points (circles).
2. Spreadsheets where each row refers to a **region** such as a local government area or divisions. Columns must be named according to the [csv-geo-pacific](https://github.com/PacificCommunity/csv-geo-pacific) standard. These will be displayed as regions, highlighting the actual shape of each area.

Spreadsheets must be saved as CSV (comma-separated values).

Standard spatial formats such as GeoJSON and KML are also supported.

There are two ways to load your data:

* Drag your data file onto the PacificMap map view. The format of the data file will be auto-detected.
* Click on the **Upload** button in the left-hand panel. This will launch the Data Catalogue. Select the **My Data** tab at the top of the modal window and follow the provided instructions.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXOIc5iBOuNpv31Ude%2F-MKXOUMB_RIx-4MoPxRi%2Fimage.png?alt=media\&token=7436628d-a284-4bae-a6fc-b7a81aa4ae30)

As with datasets which are already part of the Pacific Data Hub, you can click on regions or points to see the available data for a given feature. If the file is a CSV, data from all columns will be shown in the feature information dialogue when you click.

You can also use all of the features of the [Data Workbench](https://map.pacificdata.org/help/data-workbench.html) on your dataset.

To share a view of your data with others, you must first upload the dataset to the Pacific Data Hub Catalogue.&#x20;

### How to share my PacificMap view with others

* In the top right corner click on **Share/Print.**

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXi9VpDZ9ivg8PVRos%2F-MKXoUlLjlH9lAvmFjxN%2Fimage.png?alt=media\&token=402e7061-fe3c-4608-b1d6-7a2bf8871a7d)

There are three ways of sharing your map view:

* **Share URL.** Copy the given URL (shown in the first text box) to the clipboard and paste it into an email which you send to the recipient. They can click on it in the email or paste it into their browser to see the same view as you.
* **Print Map.** Generates a static map that can be shared using different formats. Note that this option is the only one that will show data loaded from a local file or URL.
* **Advanced Options.** Create a code to embed the map into a web page.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXpp944-VpMOHoROOp%2F-MKXqO4uNgGRRd5vXuEB%2Fimage.png?alt=media\&token=9ce27292-58d5-4e24-8547-34276fb14e5a)

### How to contribute Data Sets to PacificMap

PacificMap encourages data providers to publish their spatial data using this platform. There are two routes you can take to publishing.

* Any spatial data which is added to [Pacific Data Hub](https://pacificdata.org/) using a protocol or format supported by the PacificMap (such as WMS) will automatically appear in the **PacificDataHub** section of the **Data Catalogue** tab for the PacificMap.
* If you require your data set to appear under a separate category of the PacificMap Data Catalogue, you will need to contact  <datahub@spc.int> for more information.&#x20;

### How to visualize Geographic data stored in the Pacific Data Hub Catalogue&#x20;

Datasets in the Pacific Data Hub containing geographic data will be tagged with the **Geographic data** label

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXqu5mYInyqtIgz0LF%2F-MKXvb_20F_SFXgm_m6n%2Fimage.png?alt=media\&token=5c68bd54-1320-4f6a-9036-363e541da21c)

The resources within the dataset containing geographic data come with the **PacificMap** label&#x20;

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXqu5mYInyqtIgz0LF%2F-MKXvyVCMH1bikKAepdo%2Fimage.png?alt=media\&token=2cc325d9-4d73-49d3-9639-bf15a5e7744b)

* When opening one of the files containing geographic data, three map preview options are made available.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXwoYasdwZ6aGDfz9r%2F-MKXxTZN3GQBIzmm48ku%2Fimage.png?alt=media\&token=7ef66c43-3203-42c2-904b-f5407fc7ee7f)

* Select **PacificMap** option and the geospatial dataset will be displayed on an embed frame.
* Click on **Open in PacificMap** if you want to open your the dataset on a PacificMap instance independent from the Pacific Data Hub Catalogue

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKXwoYasdwZ6aGDfz9r%2F-MKXyQbsk6I9NuOq222Q%2Fimage.png?alt=media\&token=a053c14c-5952-4009-9050-90dce47d3348)


# PDH.stat

Search, visualise and share Pacific data

[Pacific Data Hub .Stat](https://stats.pacificdata.org/) (commonly known as PDH.stat) is a powerful interactive online tool that presents a wide range of statistical indicators in a flexible and dynamic manner. PDH.Stat empowers users in their quest for Pacific data by providing state-of-the-art search functionalities and offering a user-friendly interface to extract information from voluminous data tables.&#x20;

PDH.Stat contains more than 350 indicators represented in tables which include population figures, main economic indicators, social statistics and SDGs, and is continually expanding. A [full list of indicators available in PDH.stat can be found here](https://sdd.spc.int/indicators-stat).

Different applications and use cases are targeted to different types of users:

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJy8TEnTSs84xKAOGWH%2F-MJy9-TMSEcbllRR3LJf%2Fimage.png?alt=media\&token=5bf8f441-f9f5-4d12-bd38-2741d6f8bb97)

Data in PDH.stat in structured and standardized and uses open standards making it easy to use.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJy8TEnTSs84xKAOGWH%2F-MJy98QG5MAsAMYqh4uX%2Fimage.png?alt=media\&token=9d402329-5047-4ae1-93dc-e267b1e72e30)


# Data Explorer

The user-friendly interface to Pacific data

For an introduction on how to use the Data Explorer see this video :

{% embed url="<https://youtu.be/mbY7nAJvQ8c>" %}

## Access the PDH.stat Data Explorer

### Via PDH.stat URL

PDH.stat Data Explorer is directly accessible via the following URL:

<https://stats.pacificdata.org/>

### From the Data Catalogue

The application is also accessible in several ways from the [Data Catalogue](/catalogue):

A link is available from the "Tools" menu:

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJyufUsUAiOqvuJeIia%2F-MJyv5VeuRj1A4_H-IV-%2Fimage.png?alt=media\&token=ab4f17b9-28c0-4081-acfc-00b8d3d28a90)

PDH Data Catalogue entries have a link to visualize the data in the Data Explorer as a source:

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJyufUsUAiOqvuJeIia%2F-MJyvylwZCDuW09325zL%2Fimage.png?alt=media\&token=153c47a8-a726-4b94-acf1-c25d10a75dbe)

## Find data

### Using predefined topics or textual search

From the welcome page of the Data Explorer data can be searched using predefined topics or using textual search.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz-Hw4Ie3Cu3LfbVpE%2F-MJz0T5E6r9LHLqClKmd%2Fimage.png?alt=media\&token=231f7cef-18bb-4b3c-b6ba-4cec6d7f5893)

Textual search will not only return datasets mentionning serch text in their name or description but also datasets containing occurence of the text in code labels or comments used in the data.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz-Hw4Ie3Cu3LfbVpE%2F-MJz0kb4LVynbd2y9ytM%2Fimage.png?alt=media\&token=1634fe7c-b1de-4bee-b954-563cf0bd8645)

### Faceted search

The research results page implements what is called a "faceted search" allowing search criteria to be refined in a second step using a filtering panel on the left side of the screen.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz-Hw4Ie3Cu3LfbVpE%2F-MJz2Ke5Z7joZAusVan5%2Fimage.png?alt=media\&token=9724776c-5b47-44c5-ac3c-697d40aa9b55)

### From the Data Calalogue

&#x20;PDH.stat data is registered in the Data Catalogue and can also be found using its various different functionnalities. For more information see [dedicated section on the use of the Data Catalogue](/catalogue).

## View the data

Datasets are first displayed according to a predefined default view.

Filters applied to the default view are visible in the filtering panel on the left side of the screen,&#x20;

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz36FBWXhYPf0UQTnT%2F-MJz43xcC512jKZ7PMPT%2Fimage.png?alt=media\&token=9f143967-b4f4-42ad-a891-a8c9ac4fadd8)

A maximum number of observations will be displayed in the Data Explorer to prevserve user experience. If this limit is exceeded the dataset will be trucated and a warning message will be displayed at the top of the table.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz36FBWXhYPf0UQTnT%2F-MJz4ZRkB73qlV2U2zAV%2Fimage.png?alt=media\&token=c4c4dbbc-b44b-4c40-af3c-ac8abdbf44ba)

## Refine selection

Filters can be managed from the filtering panel on the left of the data table.&#x20;

* The upper side of the panel shows applied filters and allow to easilty clear filters (remove one category, remove all categories selected for a given dimension, clear all filters)
* The lower side of the panel shows available filters and allows defining filters (add or remove individual categories for each dimension)

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz4jOomXtgWpEfz8fg%2F-MJz6bt0VSCzurzfAGXr%2Fimage.png?alt=media\&token=fe19dba1-0d95-46d2-8527-5c02369761e8)

* To remove a category click on the cross next to the category&#x20;
* To remove all selected categories for a given dimension click on the cross next to the dimension label
* To clear all filters appalied to the dataset click on the cross next to the dimension label

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz4jOomXtgWpEfz8fg%2F-MJz8-1_QX3SkYF-n81d%2Fimage.png?alt=media\&token=20f810c7-68e1-4873-8e41-ad65f1923a44)

To define filters the lower part of the filtering panel can be used to add or remove categoires from the data selection for each dimension.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz85Hp4Wz1Q1s_oP4W%2F-MJz8kpMEebrxBGRxNo2%2Fimage.png?alt=media\&token=ed95369f-0a04-47e4-8ba1-b7565ddd104f)

* Selectect categories are highlighted,&#x20;
  * Clicking on an unselected category ads it to the selection
  * Clikcing on a selected category removes it from the selection
* When no catgory is selected for a dimension all categories are part of the selection
* The presence of a chevron to the right of the category label indicates that subcategories are available, clicking on the chevron symbol will display sub-categories
* The numbers in the green rectangle next to dimension labels inidicate how many categories are selected from the total number of categories available for the dimension

## Reshape the table

In the Data Explorer dimensions may be displayed as row section, row or column.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz9NYf0dxyQ9_4hA66%2F-MJzAnd01xftBx2AthSK%2Fimage.png?alt=media\&token=4adb8d43-e8f5-4884-b7e6-f454eda489fd)

Table layout can be customized using the "customize" functionnality available by clicking the appropriate item on ribbon above the data table.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJylctY_fMy57DJjWif%2F-MJymIIy-btO9CIgDuRg%2Fimage.png?alt=media\&token=d684d8e5-d48d-4875-a1b7-227417bff38e)

Dimensions can be dragged between columns, row sections and rows.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJz9NYf0dxyQ9_4hA66%2F-MJzBZZkf-ZA9lUBSGok%2Fimage.png?alt=media\&token=0ce43fdd-611f-47b2-8a21-557511720988)

The new table view is applied once the "apply layout" button is clicked.

At least one dimension must set for rows.

When multiple dimensions are set as columns, row section or row the order in which they are mentionned is significant and corresponds to the order in which they will be nested in the table view. Dimensions can be re-ordred using drag and drop.

## Share by e-mail

A share functionnality allows sending a link to the data currenlty displayed in the Data Explorer per e-mail.

To access this functionnality the "Share" item from the top menu must be clicked.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJylctY_fMy57DJjWif%2F-MJymP6NLAwThg2NM5OF%2Fimage.png?alt=media\&token=ab78fe1a-38da-47c2-99cd-d95b101cfbeb)

Data can be shared in 2 ways :

* As a snapshot of data meaning that data will not change even if updated on the site
* As a view of latest data available meaning that latest available data will always be shown when the shared link is clicked

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJyqAinxk0YcpPBIhBn%2F-MJysEVnH0RjDRaaPWrj%2Fimage.png?alt=media\&token=3a941538-e7fc-404d-867e-79469a5d6bcb)

The email address to which a link will be sent must be provided. The first time an email is sent the address must be validated by clicking the "valide email link" in the message received from the Data Explorer.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJyqAinxk0YcpPBIhBn%2F-MJytTYKegu1re3lnNI2%2Fimage.png?alt=media\&token=115c8add-44dc-4c55-8a9b-d62ccaf55d88)

## Export data

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJylctY_fMy57DJjWif%2F-MJymVS9PScA00w_qafu%2Fimage.png?alt=media\&token=14846e37-b524-478c-a404-7635584fe90e)

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJyqAinxk0YcpPBIhBn%2F-MJyqrE2HOHRci28jMU7%2Fimage.png?alt=media\&token=099a91e5-bba8-486e-966d-953d5b188bcb)

Data can be downloaded as Excel or as CSV, for CSV files it is possible to export only data currently dispalyed considering filters applied or to export the entire dataset whithout any filtering.

## Link to metadata

When a metadata document is available it will be accessible from the "Download" menu by clicking the "Metadata" link next to a blue "i" icon.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJylctY_fMy57DJjWif%2F-MJymVS9PScA00w_qafu%2Fimage.png?alt=media\&token=14846e37-b524-478c-a404-7635584fe90e)

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJymwF3_crMRgFWziV5%2F-MJyoUiGYG1yWT3eRegb%2Fimage.png?alt=media\&token=4743b7cb-de91-41c5-8900-3f8be55987ce)

Metadata documents comprise a first section with reference metadata (data description, data source, processing, coverage, ...) and a second section with information on the data structure (columns and codelists).

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJymwF3_crMRgFWziV5%2F-MJynn2OkEZXQ9Chpvxz%2Fimage.png?alt=media\&token=974a2834-8338-4591-b2f2-8834bc39c1db)

## Get API queries corresponding to the data selection

API queries corresponding to the data view currentlty displayed in the Data Explorer can be accessed using the "More" menu.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJylctY_fMy57DJjWif%2F-MJymrnGgA8BIkc1SI7Z%2Fimage.png?alt=media\&token=20d37b73-ae08-46ea-b48d-5dbbf4babae8)

Separate API queries are provided for data and for structural metadata.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJyqAinxk0YcpPBIhBn%2F-MJyrFS9LxbyPJ4smXZZ%2Fimage.png?alt=media\&token=b894f8a0-3e31-42bf-b236-ebb536d2cdfd)

For more information see [dedicated section on the use of the API](/dotstat/api).


# Plugins

Access Pacific data with your favorite data analysis software

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MJyJFiLJ0QbLrw-jUnA%2F-MJyM_LWe_1J0yKAKzmT%2Fimage.png?alt=media\&token=61e3387f-a98c-48be-8b58-484297e4fcd8)


# Excel

Create a live connection between your Excel Workbooks and PDH.stat

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHQ0_fEJyfyW0QPudD%2F-MKHQ5wUCGoob-Dp26-q%2Fimage.png?alt=media\&token=2bd742ae-fd96-4dfe-89a9-e9c0643453fb)

### Installation

1: Download the addin [here](https://gitlab.com/sis-cc/.stat-suite/dotstatsuite-excel-addin).&#x20;

2: Right-click the zipped folder, choose "Extract All...", choose where you would like to extract the files (optional), then click "Extract".

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHsZ-l0CA1llgHt5I3z%2F-MHsZDpPnlF26U2DU_qg%2Fextract.png?alt=media\&token=6c40176a-2634-467a-a82f-a28f7bb33e38)

3: In the extracted folder, navigate to “Stat-DLM” folder.

4: Double click the “resign” Windows Batch File to start the installation process.

5: If a warning appears saying "Windows protected your PC", click "More info" and then "Run anyway".

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHsZ-l0CA1llgHt5I3z%2F-MHsZDpO_a1_NNYzdWLz%2Fwarning.png?alt=media\&token=d255acb7-2091-44df-86a6-f15fe10856c5)

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHsZ-l0CA1llgHt5I3z%2F-MHsZDpN2PqFaWcjIXk5%2Frunanyway.png?alt=media\&token=f35ad637-0164-4682-adcb-b60625397429)

6: Wait while the file opens a "command prompt" window and writes a few lines.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHsZ-l0CA1llgHt5I3z%2F-MHsZDpM2sPeLiJbNq5a%2Fterminal.png?alt=media\&token=3c04f44e-93ca-4293-aab7-b2515d26db8d)

7: When prompted press any key on the keyboard to finish the setup.

8: Now, in the “Stat-DLM” folder, run the “setup” Application File.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlMeOFg6DXgtJYKysm%2Fexcel1.png?alt=media\&token=7776ebd9-0b32-4f32-87dc-74d14c8a8d2b)

9: Another warning will most likely appear. If it is like the previous warning, click "More info", then "Run anyway".

10: Once a prompt like below appears, the installation has started successfully. Click "Install" and wait for the process to complete. **If a prompt like below hasn't appeared, you may need to run "setup" again.**

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHsZ-l0CA1llgHt5I3z%2F-MHsZ8MUcMHCHRxmKxdj%2Finstallit.png?alt=media\&token=748060c4-1973-451c-88bd-858ea45ce257)

11: Open Excel and choose an existing file or make a new one.

12: Find the installed add-in under the "PDH.stat" heading on the Excel Ribbon.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlMtqWAvnqNGTsaFzT%2Fexcel2.png?alt=media\&token=c66f15c5-ad22-4f6c-9c32-5bac4ed0a350)

### Basic Usage

1: Navigate to the “PDH.stat” add-in on the Excel Ribbon.

2: Click “New Table” and then “PDH” to connect to the Pacific Data Hub.

3: Wait while the application loads temporarily.

4: A window will appear, allowing you to select data from PDH.stat.

5: In “Step 1 – Select data”, under “Datasets and queries”, click the drop-down menu to select a data set.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlMzEuEDz0GdUpZsBK%2Fexcel3.png?alt=media\&token=1af6668b-d9b6-4daf-bdba-2c04b70a9568)

6: Depending on the selected data set, the “Data filters” will change.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlN3eU_4hD30HEqjnk%2Fexcel4.png?alt=media\&token=3da78748-1f08-4525-9dfd-508fb25ace47)

7: Click “EDIT FILTERS” to step through each filter and choose from the available options.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlN7qfxzvHfI381KNf%2Fexcel5.png?alt=media\&token=88be768b-7f52-4d6c-baf9-df732f188b02)

8: Click “APPLY FILTERS” to finish editing filters.

9: Click “NEXT STEP”.

10: In “Step 2 – Specify output”, settings can be adjusted to choose where to put the data loaded from PDH.stat.

11: Adjust “Start cell” to choose which Excel Sheet and cell to put the data.

12: From the “Table type” menu, choose how the data should be formatted: “Flat” (all data), “Time Series Down” (rows for each time period), or "Time Series Across” (columns for each time period).

13: Adjust “Return” to choose whether to have “Labels” or not, and in which language. Selecting “Labels” will provide the real names for all data, otherwise the data will make use of codes. Select “Exclude Codes” to remove the codes altogether.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlNDSTaeIBNws6LjJB%2Fexcel6.png?alt=media\&token=613459be-8057-48d1-ab15-cc556d927c01)

14: Click “GET DATA” and wait while the data is retrieved from PDH.stat.

15: The data will be loaded into the selected Excel Sheet.

16: To load more data, add a new Excel Sheet and repeat the above steps.

### Additional Functionality

With a data set already loaded, the add-in provides extra features.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlNLmBvE_BaU61zjRr%2Fexcel7.png?alt=media\&token=4acad5c8-b8d7-49c7-adad-5cbd4119a5c9)

**Edit the data connection:** Select “Change Selection” to adjust the settings of the current data connection and reload the data in the same location. NOTE: this will remove the existing data in that location.

**Refresh the data connection:** Select “Current Sheet” to refresh the data in the current Sheet. Select “All Sheets” to refresh the data in all Sheets with data connections.

**Metadata on the current connection:** Information about the data connection on the current Sheet is displayed in the Ribbon under PDH.stat, including the data set code, the source, and the last extraction date.

**See the API query:** When adding a connection or changing an existing one, in “Step 2 – Specify output” there is a button showing “SHOW QUERY SYNTAX”. Select this to see how your customised filters are represented in a request to the actual PDH.stat API. The API call is shown in several different formats.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlNPkfXc7kAEYPjNXD%2Fexcel8.png?alt=media\&token=9e7a2c50-6d25-499a-a27a-0457a7b2012b)

### Troubleshooting

**“This size of data exceeds MS Excel limits”:** If no filters are applied, there may be too much data to represent it in Excel (especially if the “Table type” is set to “Time Series Down”). To fix this, set “Table type” to “Flat” or introduce some filters so that the data set is smaller.

**“No data available for this selection”:** If very specific filters are applied, there may be an error and no data will appear. This is likely because there aren’t any data for the specified filters. To fix this, broaden the search terms and remove some filters.

### Uninstall (Windows 10)

1. Search “Settings” in the Windows Start Menu.
2. Go to “Settings” and then navigate to “Apps”.
3. Go to “Apps & features”.
4. Search for “.Stat DLM”.
5. Click on “.Stat DLM” and choose “Uninstall”.
6. Follow the prompts to uninstall the add-in.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MGlJTnl2VmIftLNn3CH%2F-MGlNU8iqsgOIuGT5yBx%2Fexcel9.png?alt=media\&token=5baaadf5-85cc-457e-8c69-23ed6b0a27ae)


# Power BI

Produce reports and dashboards with Power BI using a PowerQuery template

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHQ0_fEJyfyW0QPudD%2F-MKHQDaQsdaigoQMT2fS%2Fimage.png?alt=media\&token=82d9571d-e413-4dde-844e-366d755ec658)

The OECD has developed a plugin to connect an SDMX data source directly to Power BI. It can be loaded when adding "an alternate data source" in PowerBI.

![SDMX Plugin](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDSpD50SdXxsYnU7P9D%2Fuploads%2FvbBuET8AbTMCK8IPBZjL%2FSDMX%20powerbi.png?alt=media\&token=afd06b3e-9b51-47ed-86d6-c6bc77d10cf2)

To import a dataset you will need the API query corresponding to the data to be imported using the Data Explorer as [explained here](https://docs.pacificdata.org/dotstat/de#get-api-queries-corresponding-to-the-data-selection).

Then you can create a new data source in Power BI: Data > Get Data > SDMX. For importation mode, you can choose between labels only, codes only or both. [(Official plugin documentation)](https://sis-cc.gitlab.io/sdmx-tools/documentation/using-sdmx-powerbi-connector/how-to-use/)

![Plugin configuration window](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-Mdz2iHjSUz1ST83bknX%2F-MdzHYG8AxOXPFCtRQMl%2Fimage.png?alt=media\&token=c34fb87f-d8e7-4fc5-9fa7-ee19d565fa5c)

When the data is imported you can transform it with Power Query ("Transform Data" button) to remove useless columns, clean some fields or anything else.

![Imported Data](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-Mdz2iHjSUz1ST83bknX%2F-MdzIKjXgyxLTpXCldNZ%2Fimage.png?alt=media\&token=7a4e84ba-f4b9-481d-8cf2-d237e3a727e5)

The next screenshot shows a Power Query with the previously imported data, transformed with some steps.

![Data transformations with Power Query](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-Mdz2iHjSUz1ST83bknX%2F-MdzISUmX8mp743Aq7Oh%2Fimage.png?alt=media\&token=6ef63900-8034-4c3b-bb32-0f048b180e21)

Finally, your data is now imported and transformed, you can use it to do some visualisations.

![Visualisation Example](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-Mdz2iHjSUz1ST83bknX%2F-MdzIdbPH0yRrRGIh8jH%2Fimage.png?alt=media\&token=13c21a9f-3874-436b-9d77-f91c64682073)

NOTE: Because this plugin is free and open source, its code is publicly available in this [repository](https://gitlab.com/sis-cc/sdmx-tools/sdmx-power-bi).


# R

Run advanced statistical analyses on Pacific data using the rsdmx package

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHV2uUL2S5HLMigWA6%2F-MKHVi771sb__da9awKH%2Fimage.png?alt=media\&token=7281d340-7229-4a4c-923b-c36cddf34d94)

### Overview

PDH.stat is part of the `rsdmx` package, developed by Emmanuel Blondel, and contributors Matthieu Stigler and Eric Persson. Learn more about the original package [here](https://github.com/opensdmx/rsdmx). It has been configured to include Pacific Data Hub's .Stat API as a default service provider.

### Installation

These steps have been tested with R 4.0.2 on Windows 10.

Remove rsdmx if already installed: `remove.packages("rsdmx")`

Install devtools: `install.packages("devtools")`

Install rsdmx from the latest development version on Github: `devtools::install_github("opensdmx/rsdmx")`

### Basic Usage

This is a quick-start guide. Go [here ](https://cran.r-project.org/web/packages/rsdmx/vignettes/quickstart.html)for the official documentation.

Load package: `library(rsdmx)`

**See all service providers**

Aside from PDH.stat, the original package offers connectivity with OECD, Eurostat and others. See all available service providers with the `getSDMXServiceProviders()` function.

```r
as.data.frame(getSDMXServiceProviders())
```

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MSZsSloJ-gdAsmzzXtV%2F-MS_1H7ccYyrgZAChKII%2Fr1.png?alt=media\&token=24bcc7af-b92f-46b8-8bf1-99f591839678)

**See available dataflows from PDH.stat**

To see the available PDH.stat dataflows (data sets), use the `readSDMX()` function, setting the `providerId` parameter to "PDH" and the `resource` parameter to "dataflow":

```r
as.data.frame(readSDMX(providerId="PDH", resource="dataflow"))
```

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHKJBmNl25KXgZAMCoe%2F-MHKJSMifu4WQpAwan34%2Fgetdataflows.png?alt=media\&token=5cb08ac3-c8ae-4c50-be74-14cd2dc1d141)

To return the available data set IDs and their English names, filter the dataframe:

```r
as.data.frame(readSDMX(providerId="PDH", resource="dataflow"))[c("id", "Name.en")]
```

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHKJBmNl25KXgZAMCoe%2F-MHKJTuY-jSWrAt-LQPq%2Fgetdataflowsandnames.png?alt=media\&token=89ea2666-5aee-42ce-b44e-11d530811c8c)

**Get all data for a dataflow**

To retrieve a dataflow, provide the dataflow ID to the `readSDMX()` function in the `flowref` parameter, also setting the `resource` as "data".

For example, to connect to "Inflation Rates" dataflow, the ID is "DF\_CPI" (as shown when retrieving all the dataflows for PDH.stat):

```r
sdmx <- readSDMX(providerId="PDH", resource="data", flowRef="DF_CPI")
df <- as.data.frame(sdmx)
```

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHKJBmNl25KXgZAMCoe%2F-MHKJQpCcliSBCiPZwr_%2Fgetcpidata.png?alt=media\&token=b66d57d0-efd0-416d-a9b4-26e7e5162281)

**Get more specific data for a dataflow**

Extra parameters can be supplied the `readSDMX()` function to retrieve a filtered view of the dataflow:

* `start` is the desired start year (supplied as an integer)
* `end` is the desired end year (supplied as an integer)
* `key` controls a variety of filters, and by default it is set to "all" (retrieves all data). A further explanation is provided below.

The `key` parameter controls a different number of variables depending on the dataflow, including time period, country, currency and others. Each variable is selected with a code, and separated by a dot `.` Two dots `..` indicates a "wildcard" (selects all available values). A plus `+` can allow multipled variables to be selected. Generally the time period comes first, `A` for "annual" or `M` for "month" (if the data is available at that level). Some examples:

* For `DF_CPI` "Inflation Rates" dataflow, to get annual data from 2010-2015 for Cook Islands and Fiji:
  * The `key` is `"A.CK+FJ.."`
  * `start` is 2010 and `end` is 2015
  * The R code:

```r
as.data.frame(readSDMX(providerId = "PDH", 
                resource="data", 
                flowRef="DF_CPI", 
                key="A.CK+FJ..", 
                start=2010, 
                end=2015))
```

Given that the `key` variables can change depending on the dataflow, it can be easier to retrieve all data and then filter manually in R. Alternatively, use the [Data Explorer](https://stats.pacificdata.org/?locale=en) to filter a dataset and then view the relevant API call and key as explained [here](/dotstat/de#get-api-queries-corresponding-to-the-data-selection).

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHKJBmNl25KXgZAMCoe%2F-MHKJOGzJP-39JzCu1aZ%2Fcookfiji.png?alt=media\&token=b5ea0ba7-c891-4e85-92df-57a563760669)


# Python

Access Pacific data with the most popular data science solution using the pandasdmx library

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHV2uUL2S5HLMigWA6%2F-MKHW2dcdpOXQ0RLrNth%2Fimage.png?alt=media\&token=a881c3d5-b7dd-4584-aa98-d3f40b8fc775)

### Overview

PDH.stat is part of the `sdmx` Python package developed by Paul Natsuo Kishimoto. More information about the package can be found [here](https://sdmx1.readthedocs.io/en/latest/index.html).

### Install sdmx

These steps have been tested with Python 3.7.4 in an Anaconda environment on Windows 10.

Start by installing sdmx. To learn more about the package, see the code [here](https://github.com/khaeru/sdmx).

To install with pip from the command prompt (note: include the '1' at the end of sdmx): `pip install sdmx1`

In a Python project, import the package: `import sdmx`

### Connect to PDH.stat

To see the available sources and find PDH.stat:

```python
import sdmx
sdmx.list_sources()
```

The source abbreviation for PDH.stat is "SPC" (Pacific Community), as shown below.&#x20;

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHshEl8HrNo8hnZtCjv%2F-MHsj9axhyXVJrfVNVla%2Fsources.png?alt=media\&token=e70a58fc-8662-4aa9-ad8a-d7b9cdb13ad9)

To connect to PDH.stat and then view its available data flows:

```python
spc = sdmx.Client('SPC')
datasets = sdmx.to_pandas(spc.dataflow().dataflow)
datasets
```

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHshEl8HrNo8hnZtCjv%2F-MHsjhcdKvsk9fEyFHKo%2Fdf.png?alt=media\&token=a0353ee1-23c8-4076-9d0c-3d966a53aa49)

To connect to a data flow and convert it into a pandas Multi-index series:

```python
data = spc.data('DF_CPI')
df = sdmx.to_pandas(data)
df
```

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MHshEl8HrNo8hnZtCjv%2F-MHsk6tCUqI7YWkIyXmy%2Fdata.png?alt=media\&token=23213842-4257-4817-ae78-29af98ac1ac7)

And then to turn the series into a dataframe, reset the index:

```python
df = df.reset_index()
df
```

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKO8DQIjhIfgMHFhOV_%2F-MKO8M8IJurDM4XdDL8k%2FScreenshot%202020-10-24%20154653.png?alt=media\&token=26b6b7b8-8ff3-4fec-8165-f9cebe55ae4e)

For an example of how to use the plugin in combination with the API key and parameter settings, see the [time series plot example](/dotstat/api/scode#plot-time-series-population-data-using-the-python-plugin-with-pdh-stat-api).


# STATA

Connect STATA to PDH.stat with sdmxpdh

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHetHGi-a_TSbyhuEU%2F-MKHfZ4Fnf5WYRiNa6EZ%2Fimage.png?alt=media\&token=89866e53-fca6-4468-8393-b61dd0f35b4b)

## STATA

### sdmxpdh

SDMXPDH is a version of the SDMXUSE Stata module, with the changes allowing users to connect to Pacific Data Hub .Stat API (PDH.stat). See the code [here](https://github.com/PacificCommunity/statasdmx).

Full credit goes to Sebastien Fontenay, Robert Picard, Nicholas Cox.

This module is a simple adaptation of the SDMXUSE module (Fontenay), which itself uses the MOSS module (Picard & Cox).

Sebastien Fontenay, 2016. "SDMXUSE: Stata module to import data from statistical agencies using the SDMX standard," Statistical Software Components S458231, Boston College Department of Economics, revised 30 Sep 2018.

Robert Picard & Nicholas J. Cox, 2011. "MOSS: Stata module to find multiple occurrences of substrings," Statistical Software Components S457261, Boston College Department of Economics, revised 29 Apr 2016.

### Installation

Instructions work for Stata SE 15.1 in Windows

Download `.ado` and `.sthlp` files from the Github repository [here](https://github.com/PacificCommunity/statasdmx).

In Stata, find your "PERSONAL" directory path with the command: `sysdir`

In Windows, go to the "PERSONAL" directory location. It is probably `C:\ado\personal\`. If the path doesn't seem to exist, make the necessary folders yourself.

Put `.ado` and `.sthlp` files inside your "PERSONAL" directory.

Restart Stata.

Check the install worked by bringing up the SDMXPDH help document: `help sdmxpdh`

### Quick start

PDH.stat resources are maintained by SPC (Pacific Community), so SPC is the provider for resources.

General command structure is: `sdmxpdh <resource> <provider>, <filters>`

#### See all dataflows from Pacific Data Hub

```r
sdmxpdh dataflow SPC, clear
list
```

#### Get all data for a dataflow

For example, use dataflow `DF_CPI` (Consumer Price Index)

```r
sdmxpdh data SPC, clear dataset(DF_CPI)
list
```

#### Get specific data for a dataflow

This time, we want `DF_CPI` time series data from 2005 to 2018, for countries Fiji and Guam.

```r
sdmxpdh data SPC, clear dataset(DF_CPI) dimensions(A.FJ+GU.INF.) start(2005) end(2018) timeseries
list
```

Using the `dimensions()` option is tricky, see the API [documentation ](/dotstat/api)for a guide.

#### Get a datastructure definition for a dataflow

Again, let's use `DF_CPI`.

```r
sdmxpdh datastructure SPC, clear dataset(DF_CPI)
list
```


# API

Integrate your IT applications to the Pacific data ecosystem

PDH.stat provides machine-to-machine accessibility to Pacific data through its RESTful API. A freely available SDMX-based web service is exposed on the Web at the following endpoint:

{% embed url="<https://stats-nsi-stable.pacificdata.org>" %}

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MK7yGdpEuh5mHRmRAjf%2F-MK7zRP0AcciiPDbdeZ3%2Fimage.png?alt=media\&token=fae3f5a9-5062-48a8-9787-78011378cbe0)

![Overview of main queriable SDMX classes](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MK8BWxx0p7jflfZKLf3%2F-MK8BrgPmDxI5XAGuG6W%2Fimage.png?alt=media\&token=cf59a464-c1f2-4767-b685-70874e0df8fa)

Sample API calls corresponding to particular data views can be produced from the Data Explorer, for more information on this see [dedicated section from the Data Explorer documentation](/dotstat/de).

For more information on SDMX web services see the following references:

* [SDMX official website](https://sdmx.org/)
* [SDMX information model](https://sdmx.org/wp-content/uploads/SDMX_2-1_SECTION_2_InformationModel_2020-07.pdf)
* [SDMX REST web services guidelines](https://github.com/sdmx-twg/sdmx-rest/) and its [SDMX 2.1 RESTful web services cheat sheet](https://github.com/sdmx-twg/sdmx-rest/blob/master/doc/rest_cheat_sheet.pdf?raw=true)


# Interface

Pacific Data Hub .Stat API. Access macrodata datasets about the Pacific region. Data is available in XML, JSON and CSV formats.

## Data queries

## Get data

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/data/{flow}/{key}/{provider}[?startPeriod][&endPeriod][&dimensionAtObservation][&detail][&format]`

This method retrieves the data observations for a dataflow, based on various filters.

#### Path Parameters

| Name                   | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| flow                   | string | <p>The <strong>statistical domain</strong> (dataflow) of the data to be returned.<br>Examples:<br><code>DF\_SDG</code>: The ID for Sustainable Development Goals dataflow<br><code>DF\_CPI</code>: The ID for Consumer Price Index dataflow<br><code>DF\_POCKET</code>: The ID for Pocket Summary dataflow<br><code>DF\_POP\_SUM</code>: The ID for Population dataflow<br><code>DF\_IMTS</code>: The ID for International Merchandise Trade Statistics dataflow</p>                                                                                                                       |
| key                    | string | <p>The (possibly partial) <strong>key identifying the data to be returned</strong>.<br>The keyword <code>all</code> can be used to indicate that all data belonging to the specified dataflow and provided by the specified provider must be returned. The allowable values for key will change depending on the selected dataflow. In general, it is a series of parameters separated by the <code>.</code> sign. Where there are 2 points in a row, it indicates a "wildcard" for that parameter. To select several values as a parameter, separate them with a <code>+</code> sign.</p> |
| provider               | string | <p>The agency maintaining the artefact to be returned (i.e. <code>SPC</code>). <br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                          |
| startPeriod            | string | <p>The start of the period for which results should be supplied (inclusive). Can be expressed using 8601 dates or SDMX reporting periods.<br>Examples:<br><code>2000</code>: Year (ISO 8601)<br><code>2000-01</code>: Month (ISO 8601)<br><code>2000-01-01</code>: Date (ISO 8601)<br><code>2000-Q1</code>: Quarter (SDMX)<br><code>2000-W01</code>: Week(SDMX)</p>                                                                                                                                                                                                                        |
| endPeriod              | string | <p>The end of the period for which results should be supplied (inclusive). Can be expressed using 8601 dates or SDMX reporting periods.<br>Examples:<br><code>2000</code>: Year (ISO 8601)<br><code>2000-01</code>: Month (ISO 8601)<br><code>2000-01-01</code>: Date (ISO 8601)<br><code>2000-Q1</code>: Quarter (SDMX)<br><code>2000-W001</code>: Week (SDMX)</p>                                                                                                                                                                                                                        |
| dimensionAtObservation | string | <p>Indicates <strong>how the data should be packaged</strong>.<br>The options are:<br><code>TIME\_PERIOD</code>: A timeseries view<br>The ID of any other dimension: A cross-sectional view of the data<br><code>AllDimensions</code>: A flat view of the data</p>                                                                                                                                                                                                                                                                                                                         |
| detail                 | string | <p>The <strong>amount of information</strong> to be returned.<br>Possible options are:<br><code>full</code>: All data and documentation<br><code>dataonly</code>: Everything except attributes<br><code>serieskeysonly</code>: The series keys. This is useful to return the series that match a certain query, without returning the actual data (e.g. overview page)<br><code>nodata</code>: The series, including attributes and annotations, without observations</p>                                                                                                                  |
| format                 | string | <p>The <strong>data format</strong> to be returned.<br>Possible options are:<br><code>jsondata</code><br><code>csv</code><br><code>genericdata</code><br><code>structure</code><br><code>structurespecificdata</code></p>                                                                                                                                                                                                                                                                                                                                                                  |

#### Headers

| Name              | Type   | Description                                                                                                                                                                                                                                                                                                                                 |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Accept-Language   | string | Specifies the client's preferred language.                                                                                                                                                                                                                                                                                                  |
| If-Modified-Since | string | Takes a date-time (RFC3339 format) as input and returns the content matching the query only if it has changed since the supplied timestamp.                                                                                                                                                                                                 |
| Accept            | string | <p>Specifies the format of the API response.<br>Possible options are:<br><code>application/vnd.sdmx.genericdata+xml;version=2.1</code>: returns SDMX-XML format<br><code>application/vnd.sdmx.data+json;version=2.1</code>: returns SDMX-JSON format<br><code>application/vnd.sdmx.data+csv;version=2.1</code>: returns SDMX-CSV format</p> |
| Accept-Encoding   | string | <p>Specifies whether the response should be compressed and how.<br><code>identity</code> (the default) indicates that no compression will be performed.</p>                                                                                                                                                                                 |

{% tabs %}
{% tab title="200 An example API request for data on Fiji's population projection (DF\_POP\_PROJ) from 2015 to 2020 (returned as XML): curl -v -X GET
"<https://stats-nsi-stable.pacificdata.org/rest/data/SPC,DF_POP_PROJ,3.0/A.FJ._T._T.MIDYEARPOPEST?startPeriod=2015&endPeriod=2020&dimensionAtObservation=AllDimensions>"" %}

```markup
Date: Fri, 16 Oct 2020 05:36:49 GMT
Content-Type: application/vnd.sdmx.genericdata+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d5be5dfdd90fc5940bf06bc555017cc891602826609; expires=Sun, 15-Nov-20 05:36:49 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e2f6ca67a10e9b3-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Content-Disposition: attachment; filename= "SPC-DF_POP_PROJ-3.0-A.FJ._T._T.MIDYEARPOPEST.csv"
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d1823c0b0000e9b3ab23d000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:GenericData xmlns:footer="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message/footer" xmlns:generic="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/data/generic" xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<message:Header>
<message:ID>IREF0919307a49a947be8b3b0ad3ed78de70</message:ID>
<message:Test>true</message:Test>
<message:Prepared>2020-10-16T05:36:49</message:Prepared>
<message:Sender id="Stable - DotStat v8" />
<message:Structure structureID="SPC_DF_POP_PROJ_3_0" dimensionAtObservation="AllDimensions">
<common:StructureUsage><Ref agencyID="SPC" id="DF_POP_PROJ" version="3.0" />
</common:StructureUsage>
</message:Structure>
<message:DataSetAction>Information</message:DataSetAction>
</message:Header>
<message:DataSet action="Information" structureRef="SPC_DF_POP_PROJ_3_0">
<generic:Obs><generic:ObsKey><generic:Value id="TIME_PERIOD" value="2017" />
<generic:Value id="FREQ" value="A" />
<generic:Value id="GEO_PICT" value="FJ" />
<generic:Value id="SEX" value="_T" />
<generic:Value id="AGE" value="_T" />
<generic:Value id="INDICATOR" value="MIDYEARPOPEST" />
</generic:ObsKey><generic:ObsValue value="883270" />
<generic:Attributes><generic:Value id="UNIT_MEASURE" value="N" />
<generic:Value id="UNIT_MULTIPLIER" value="0" />
<generic:Value id="OBS_STATUS" value="E" />
<generic:Value id="OBS_COMMENT" value="The difference between this value and the sum of male and female populations is due to rounding errors in lower-level estimates." />
</generic:Attributes></generic:Obs>
<generic:Obs>
<generic:ObsKey>
<generic:Value id="TIME_PERIOD" value="2018" />
<generic:Value id="FREQ" value="A" />
<generic:Value id="GEO_PICT" value="FJ" />
<generic:Value id="SEX" value="_T" />
<generic:Value id="AGE" value="_T" />
<generic:Value id="INDICATOR" value="MIDYEARPOPEST" />
</generic:ObsKey><generic:ObsValue value="887394" />
<generic:Attributes><generic:Value id="UNIT_MEASURE" value="N" />
<generic:Value id="UNIT_MULTIPLIER" value="0" />
<generic:Value id="OBS_STATUS" value="E" />
<generic:Value id="OBS_COMMENT" value="The difference between this value and the sum of male and female populations is due to rounding errors in lower-level estimates." />
</generic:Attributes>
</generic:Obs>
<generic:Obs>
<generic:ObsKey>
<generic:Value id="TIME_PERIOD" value="2019" />
<generic:Value id="FREQ" value="A" />
<generic:Value id="GEO_PICT" value="FJ" />
<generic:Value id="SEX" value="_T" />
<generic:Value id="AGE" value="_T" />
<generic:Value id="INDICATOR" value="MIDYEARPOPEST" />
</generic:ObsKey>
<generic:ObsValue value="891296" />
<generic:Attributes>
<generic:Value id="UNIT_MEASURE" value="N" />
<generic:Value id="UNIT_MULTIPLIER" value="0" />
<generic:Value id="OBS_STATUS" value="F" />
</generic:Attributes>
</generic:Obs>
<generic:Obs>
<generic:ObsKey>
<generic:Value id="TIME_PERIOD" value="2020" />
<generic:Value id="FREQ" value="A" />
<generic:Value id="GEO_PICT" value="FJ" />
<generic:Value id="SEX" value="_T" />
<generic:Value id="AGE" value="_T" />
<generic:Value id="INDICATOR" value="MIDYEARPOPEST" />
</generic:ObsKey><generic:ObsValue value="894961" />
<generic:Attributes><generic:Value id="UNIT_MEASURE" value="N" />
<generic:Value id="UNIT_MULTIPLIER" value="0" />
<generic:Value id="OBS_STATUS" value="F" />
<generic:Value id="OBS_COMMENT" value="The difference between this value and the sum of male and female populations is due to rounding errors in lower-level estimates." />
</generic:Attributes>
</generic:Obs>
</message:DataSet>
</message:GenericData>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}

{% tab title="404 An example response for when the request seeks a dataflow which doesn't exist." %}

```markup
Date: Fri, 16 Oct 2020 05:48:01 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=dca6803be6c4a37ae70765f99c6149ca71602827281; expires=Sun, 15-Nov-20 05:48:01 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e2f7d0b38a5329b-BNE
Cache-Control: no-cache
Expires: -1
CF-Cache-Status: DYNAMIC
cf-request-id: 05d18c7b050000329b542c0000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

Could not find Dataflow and/or DSD related with this data request* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

#### Code samples

{% tabs %}
{% tab title="Curl" %}

```java
@ECHO OFF

curl -v -X GET "https://stats-nsi-stable.pacificdata.org/rest/data/{flow}/{key}/{provider}?startPeriod={string}&endPeriod={string}&dimensionAtObservation=TIME_PERIOD&detail=full&format={string}"
-H "Accept-Encoding: "
-H "Accept-Language: "
-H "If-Modified-Since: "
-H "Accept: "

--data-ascii "{body}" 
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse(""));
            client.DefaultRequestHeaders.AcceptLanguage.Add(StringWithQualityHeaderValue.Parse(""));
            client.DefaultRequestHeaders.IfModifiedSince = DateTimeOffset.Parse("");

            client.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse(""));
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["startPeriod"] = "{string}";
            queryString["endPeriod"] = "{string}";
            queryString["dimensionAtObservation"] = "TIME_PERIOD";
            queryString["detail"] = "full";
            queryString["format"] = "{string}";
            var uri = "https://sdd-dotstat-api-gateway.azure-api.net/data/{flow}/{key}/{provider}?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
Pacific Data Hub Home

PDH.Stat Data Explorer
```

{% endtab %}

{% tab title="Java" %}

```java
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://sdd-dotstat-api-gateway.azure-api.net/data/{flow}/{key}/{provider}");

            builder.setParameter("startPeriod", "{string}");
            builder.setParameter("endPeriod", "{string}");
            builder.setParameter("dimensionAtObservation", "TIME_PERIOD");
            builder.setParameter("detail", "full");
            builder.setParameter("format", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Accept-Encoding", "");
            request.setHeader("Accept-Language", "");
            request.setHeader("If-Modified-Since", "");
            request.setHeader("Accept", "");
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

Pacific Data Hub Home

PDH.Stat Data Explorer
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
            "startPeriod": "{string}",
            "endPeriod": "{string}",
            "dimensionAtObservation": "TIME_PERIOD",
            "detail": "full",
            "format": "{string}",
        };
      
        $.ajax({
            url: "https://sdd-dotstat-api-gateway.azure-api.net/data/{flow}/{key}/{provider}?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Accept-Encoding","");
                xhrObj.setRequestHeader("Accept-Language","");
                xhrObj.setRequestHeader("If-Modified-Since","");
                xhrObj.setRequestHeader("Accept","");
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
```

{% endtab %}

{% tab title="ObjC" %}

```objectivec
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://sdd-dotstat-api-gateway.azure-api.net/data/{flow}/{key}/{provider}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"startPeriod={string}",
                         @"endPeriod={string}",
                         @"dimensionAtObservation=TIME_PERIOD",
                         @"detail=full",
                         @"format={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"" forHTTPHeaderField:@"Accept-Encoding"];
    [_request setValue:@"" forHTTPHeaderField:@"Accept-Language"];
    [_request setValue:@"" forHTTPHeaderField:@"If-Modified-Since"];
    [_request setValue:@"" forHTTPHeaderField:@"Accept"];
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
Pacific Data Hub Home

PDH.Stat Data Explorer
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://sdd-dotstat-api-gateway.azure-api.net/data/{flow}/{key}/{provider}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Accept-Encoding' => '',
    'Accept-Language' => '',
    'If-Modified-Since' => '',
    'Accept' => '',
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'startPeriod' => '{string}',
    'endPeriod' => '{string}',
    'dimensionAtObservation' => 'TIME_PERIOD',
    'detail' => 'full',
    'format' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
Pacific Data Hub Home

PDH.Stat Data Explorer
```

{% endtab %}

{% tab title="Python" %}

```python
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Accept-Encoding': '',
    'Accept-Language': '',
    'If-Modified-Since': '',
    'Accept': '',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'startPeriod': '{string}',
    'endPeriod': '{string}',
    'dimensionAtObservation': 'TIME_PERIOD',
    'detail': 'full',
    'format': '{string}',
})

try:
    conn = httplib.HTTPSConnection('sdd-dotstat-api-gateway.azure-api.net')
    conn.request("GET", "/data/{flow}/{key}/{provider}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Accept-Encoding': '',
    'Accept-Language': '',
    'If-Modified-Since': '',
    'Accept': '',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'startPeriod': '{string}',
    'endPeriod': '{string}',
    'dimensionAtObservation': 'TIME_PERIOD',
    'detail': 'full',
    'format': '{string}',
})

try:
    conn = http.client.HTTPSConnection('sdd-dotstat-api-gateway.azure-api.net')
    conn.request("GET", "/data/{flow}/{key}/{provider}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
Pacific Data Hub Home

PDH.Stat Data Explorer
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'

uri = URI('https://sdd-dotstat-api-gateway.azure-api.net/data/{flow}/{key}/{provider}')

query = URI.encode_www_form({
    # Request parameters
    'startPeriod' => '{string}',
    'endPeriod' => '{string}',
    'dimensionAtObservation' => 'TIME_PERIOD',
    'detail' => 'full',
    'format' => '{string}'
})
if query.length > 0
  if uri.query && uri.query.length > 0
    uri.query += '&' + query
  else
    uri.query = query
  end
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Accept-Encoding'] = ''
# Request headers
request['Accept-Language'] = ''
# Request headers
request['If-Modified-Since'] = ''
# Request headers
request['Accept'] = ''
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body
```

{% endtab %}
{% endtabs %}

## Structure queries

## Get dataflow

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/dataflow/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves a dataflow (or many dataflows), and the associated metadata, including the name, description, and metadata dictionary.

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. SPC).<br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| resourceID | string | <p>The ID of the artefact to be returned.<br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>).<br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| version    | string | <p>The version of the artefact to be returned.<br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>).<br>The keyword <code>all</code> can be used to return all version of the matching resource.<br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned.<br>Possible values are:<br><code>none</code>: No references will be returned<br>parents: Returns the artefacts that use the artefact matching the query<br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts<br><code>children</code>: Returns the artefacts referenced by the artefact to be returned<br><code>descendants</code>: References of references, up to any level, will be returned<br><code>all</code>: The combination of <code>parentsandsiblings</code> and <code>descendants</code><br>In addition, a concrete type of resource may also be used (e.g. <code>codelist</code>)</p>                                                                                                                                                                                                                                                                                                                                                                                            |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value.<br>Possible values are:<br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to <code>true</code><br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information<br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information<br><code>full</code>: All available information for all artefacts should be returned<br></p> |

{% tabs %}
{% tab title="200 An example request for the Consumer Price Index dataflow (DF\_CPI), specifying allstubs as the detail parameter to return a simplified view of the dataflow: curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/dataflow/SPC/DF_CPI/3.0?references=all&detail=allstubs>"" %}

```markup
Date: Fri, 16 Oct 2020 06:35:59 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=dfd97cf769efd84d0ccd013362e8a84241602830158; expires=Sun, 15-Nov-20 06:35:58 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e2fc34cde53e9bf-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d1b8640b0000e9bf31346000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11282</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T06:35:59.0586706+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:Dataflows>
      <structure:Dataflow id="DF_CPI" agencyID="SPC" version="3.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Dataflow/SPC/DF_CPI/3.0">
        <common:Annotations>
          <common:Annotation>
            <common:AnnotationType>NonProductionDataflow</common:AnnotationType>
            <common:AnnotationText xml:lang="en">true</common:AnnotationText>
          </common:Annotation>
        </common:Annotations>
        <common:Name xml:lang="en">Inflation rates</common:Name>
        <common:Name xml:lang="fr">Taux d'inflation</common:Name>
      </structure:Dataflow>
    </structure:Dataflows>
    <structure:CategorySchemes>
      <structure:CategoryScheme id="CAS_COM_TOPIC" agencyID="SPC" version="1.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/CategoryScheme/SPC/CAS_COM_TOPIC/1.0">
        <common:Name xml:lang="en">Topic</common:Name>
        <common:Name xml:lang="fr">Thème</common:Name>
      </structure:CategoryScheme>
    </structure:CategorySchemes>
    <structure:Categorisations>
      <structure:Categorisation id="CAT_CPI" agencyID="SPC" version="3.0" isExternalReference="true" isFinal="false" structureURL="http://need/to/changeit">
        <common:Name xml:lang="en">Categorisation of dataflow DF_CPI to category ECO of categrory scheme CAS_COM_TOPIC</common:Name>
      </structure:Categorisation>
    </structure:Categorisations>
    <structure:Codelists>
      <structure:Codelist id="CL_COM_FREQ" agencyID="SPC" version="1.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Codelist/SPC/CL_COM_FREQ/1.0">
        <common:Name xml:lang="en">Common codelist for data frequencies</common:Name>
        <common:Name xml:lang="fr">Liste de codes commune pour la fréquence des données</common:Name>
      </structure:Codelist>
      <structure:Codelist id="CL_COM_GEO_PICT" agencyID="SPC" version="2.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Codelist/SPC/CL_COM_GEO_PICT/2.0">
        <common:Name xml:lang="en">Common hierarchical codelist for PICTs</common:Name>
        <common:Name xml:lang="fr">Liste hiérarchique de codes commune pour les PICTs</common:Name>
      </structure:Codelist>
      <structure:Codelist id="CL_COM_OBS_STATUS" agencyID="SPC" version="1.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Codelist/SPC/CL_COM_OBS_STATUS/1.0">
        <common:Name xml:lang="en">Common codelist for observation statuses</common:Name>
        <common:Name xml:lang="fr">Liste de codes commune pour le statut des observations</common:Name>
      </structure:Codelist>
      <structure:Codelist id="CL_COM_PACCOICOP20" agencyID="SPC" version="1.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Codelist/SPC/CL_COM_PACCOICOP20/1.0">
        <common:Name xml:lang="en">Common codelist for PACCOICOP 2020</common:Name>
        <common:Name xml:lang="fr">Liste de codes commune pour PACCOICOP 2020</common:Name>
      </structure:Codelist>
      <structure:Codelist id="CL_COM_UNIT_MEASURE" agencyID="SPC" version="1.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Codelist/SPC/CL_COM_UNIT_MEASURE/1.0">
        <common:Name xml:lang="en">Common codelist for units of measure</common:Name>
        <common:Name xml:lang="fr">Liste de codes commune pour les unités de mesure</common:Name>
      </structure:Codelist>
      <structure:Codelist id="CL_COM_UNIT_MULT" agencyID="SPC" version="1.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Codelist/SPC/CL_COM_UNIT_MULT/1.0">
        <common:Name xml:lang="en">Common codelist for unit multipliers</common:Name>
        <common:Name xml:lang="fr">Liste de codes commune pour les mulltiplicateurs d'unité</common:Name>
      </structure:Codelist>
      <structure:Codelist id="CL_CPI_INDICATORS" agencyID="SPC" version="3.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/Codelist/SPC/CL_CPI_INDICATORS/3.0">
        <common:Name xml:lang="en">Codelist for consumer prices indicators</common:Name>
        <common:Name xml:lang="fr">Liste de codes pour les indicateurs des prix à la consommation</common:Name>
      </structure:Codelist>
    </structure:Codelists>
    <structure:Concepts>
      <structure:ConceptScheme id="CS_COMMON" agencyID="SPC" version="2.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/ConceptScheme/SPC/CS_COMMON/2.0">
        <common:Name xml:lang="en">Common concepts for SPC .Stat data</common:Name>
        <common:Name xml:lang="fr">Concepts communs pour les données .Stat de la CPS</common:Name>
      </structure:ConceptScheme>
    </structure:Concepts>
    <structure:DataStructures>
      <structure:DataStructure id="DSD_CPI" agencyID="SPC" version="3.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/DataStructure/SPC/DSD_CPI/3.0">
        <common:Name xml:lang="fr">Définition de la structure des données pour les prix à la consommation</common:Name>
        <common:Name xml:lang="en">Data structure definition for consummer prices</common:Name>
      </structure:DataStructure>
    </structure:DataStructures>
    <structure:Constraints>
      <structure:ContentConstraint id="CON_CPI" agencyID="SPC" version="3.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/ContentConstraint/SPC/CON_CPI/3.0" type="Actual">
        <common:Name xml:lang="en">Content constraint for DF_CPI</common:Name>
      </structure:ContentConstraint>
      <structure:ContentConstraint id="CR_A_DF_CPI" agencyID="SPC" version="3.0" isExternalReference="true" isFinal="false" structureURL="http://stats-nsi-stable.pacificdata.org/rest/ContentConstraint/SPC/CR_A_DF_CPI/3.0" type="Actual">
        <common:Name xml:lang="en">Availability (A) for DF_CPI</common:Name>
      </structure:ContentConstraint>
    </structure:Constraints>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

## Get agency schemes

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/agencyscheme/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves information about agencies associated with the .Stat instance.&#x20;

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. SPC).<br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| resourceID | string | <p>The ID of the artefact to be returned. <br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>). <br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| version    | string | <p>The version of the artefact to be returned.<br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>). <br>The keyword <code>all</code> can be used to return all version of the matching resource. <br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned. Possible values are:<br><code>none</code>: No references will be returned <br><code>parents</code>: Returns the artefacts that use the artefact matching the query<br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts<br><code>children</code>: Returns the artefacts referenced by the artefact to be returned<br><code>descendants</code>: References of references, up to any level, will be returned<br><code>all</code>: The combination of parentsandsiblings and descendants In addition, a concrete type of resource may also be used (e.g. codelist)</p>                                                                                                                                                                                                                                                                                                                                                                                                                             |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value. <br>Possible values are: <br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name <br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to <code>true</code> <br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information <br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information <br><code>full</code>: All available information for all artefacts should be returned</p> |

{% tabs %}
{% tab title="200 An example API request for all of the agency schemes (returned as XML): curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/agencyscheme>"" %}

```markup
Date: Fri, 16 Oct 2020 10:29:21 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=db72583daabc6da0e4d2c1bc99b03cc8e1602844161; expires=Sun, 15-Nov-20 10:29:21 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e3119271ed3e9bf-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d28e0c6d0000e9bf2db16000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11299</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T10:29:21.2419081+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:OrganisationSchemes>
      <structure:AgencyScheme id="AGENCIES" agencyID="SPC" version="1.0" isFinal="false">
        <common:Name xml:lang="en">SPC agency scheme</common:Name>
        <structure:Agency id="SPC">
          <common:Name xml:lang="en">Pacific Community (SPC)</common:Name>
          <common:Name xml:lang="fr">Communauté du Pacifique (CPS)</common:Name>
        </structure:Agency>
      </structure:AgencyScheme>
    </structure:OrganisationSchemes>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

## Get categorisations

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/categorisation/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves information about categories used by dataflows.

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. SPC).<br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| resourceID | string | <p>The ID of the artefact to be returned. <br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>). <br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| version    | string | <p>The version of the artefact to be returned. <br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>). <br>The keyword <code>all</code> can be used to return all version of the matching resource.<br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned. Possible values are:<br><code>none</code>: No references will be returned parents: Returns the artefacts that use the artefact matching the query <br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts<br><code>children</code>: Returns the artefacts referenced by the artefact to be returned <br><code>descendants</code>: References of references, up to any level, will be returned <br><code>all</code>: The combination of parentsandsiblings and descendants In addition, a concrete type of resource may also be used (e.g. codelist)</p>                                                                                                                                                                                                                                                                                                                                                                                                                               |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value. <br>Possible values are: <br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name <br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name <br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to true <br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information <br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information <br><code>full</code>: All available information for all artefacts should be returned</p> |

{% tabs %}
{% tab title="200 An example API request for the currencies category (CAT\_CURRENCIES) used by dataflows (returned as XML): curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/categorisation/SPC/CAT_CURRENCIES>"" %}

```markup
Date: Fri, 16 Oct 2020 10:35:42 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d500d33b55d0c10297ba7dfceedc660bd1602844542; expires=Sun, 15-Nov-20 10:35:42 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e312278b818329b-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d293df750000329b46976000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11306</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T10:35:42.9540952+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:Categorisations>
      <structure:Categorisation id="CAT_CURRENCIES" agencyID="SPC" version="2.0" isFinal="false">
        <common:Name xml:lang="en">Categorisation for the Currencies dataflow</common:Name>
        <structure:Source>
          <Ref id="DF_CURRENCIES" version="2.0" agencyID="SPC" package="datastructure" class="Dataflow" />
        </structure:Source>
        <structure:Target>
          <Ref id="ECO" maintainableParentID="CAS_COM_TOPIC" maintainableParentVersion="1.0" agencyID="SPC" package="categoryscheme" class="Category" />
        </structure:Target>
      </structure:Categorisation>
    </structure:Categorisations>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

## Get category schemes

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/categoryscheme/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves information about category schemes used by dataflows.

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. SPC).<br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| resourceID | string | <p>The ID of the artefact to be returned. <br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>).<br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| version    | string | <p>The version of the artefact to be returned.<br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>).<br>The keyword <code>all</code> can be used to return all version of the matching resource.<br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned. Possible values are:<br><code>none</code>: No references will be returned parents: Returns the artefacts that use the artefact matching the query <br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts <br><code>children</code>: Returns the artefacts referenced by the artefact to be returned <br><code>descendants</code>: References of references, up to any level, will be returned <br><code>all</code>: The combination of parentsandsiblings and descendants In addition, a concrete type of resource may also be used (e.g. codelist)</p>                                                                                                                                                                                                                                                                                                                                                                                                                             |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value. <br>Possible values are: <br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name <br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name <br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to true <br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information<br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information <br><code>full</code>: All available information for all artefacts should be returned</p> |

{% tabs %}
{% tab title="200 An example API request for all category schemes (returned as XML): curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/categoryscheme>"" %}

```markup
Date: Fri, 16 Oct 2020 10:38:25 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d70f61bc721dfb8d40bcaadbb1ff2b1281602844705; expires=Sun, 15-Nov-20 10:38:25 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e31266fb85532a4-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d29659d7000032a46a2a7000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11309</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T10:38:25.3660767+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:CategorySchemes>
      <structure:CategoryScheme id="CAS_COM_DEV" agencyID="SPC" version="1.0" isFinal="false">
        <common:Name xml:lang="en">Development indicators</common:Name>
        <common:Name xml:lang="fr">Indicateurs de développement</common:Name>
        <structure:Category id="SDG">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">10</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">10</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Sustainable Development Goals</common:Name>
          <common:Name xml:lang="fr">Objectifs de Développement Durable</common:Name>
        </structure:Category>
        <structure:Category id="NMDI">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">20</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">20</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">National Minimum Development Indicators</common:Name>
          <common:Name xml:lang="fr">Indicateurs Minima du Développement National</common:Name>
        </structure:Category>
      </structure:CategoryScheme>
      <structure:CategoryScheme id="CAS_COM_TOPIC" agencyID="SPC" version="1.0" isFinal="false">
        <common:Name xml:lang="en">Topic</common:Name>
        <common:Name xml:lang="fr">Thème</common:Name>
        <structure:Category id="ECO">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">10</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">10</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Economy</common:Name>
          <common:Name xml:lang="fr">Économie</common:Name>
        </structure:Category>
        <structure:Category id="ENV">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">20</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">20</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Environment</common:Name>
          <common:Name xml:lang="fr">Environnement</common:Name>
        </structure:Category>
        <structure:Category id="HEA">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">30</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">30</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Health</common:Name>
          <common:Name xml:lang="fr">Santé</common:Name>
        </structure:Category>
        <structure:Category id="IND">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">40</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">40</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Industry and Services</common:Name>
          <common:Name xml:lang="fr">Industrie et services</common:Name>
        </structure:Category>
        <structure:Category id="POP">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">50</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">50</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Population</common:Name>
          <common:Name xml:lang="fr">Population</common:Name>
        </structure:Category>
        <structure:Category id="SOC">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">60</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">60</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Social</common:Name>
          <common:Name xml:lang="fr">Social</common:Name>
        </structure:Category>
        <structure:Category id="XDO">
          <common:Annotations>
            <common:Annotation>
              <common:AnnotationType>ORDER</common:AnnotationType>
              <common:AnnotationText xml:lang="en">70</common:AnnotationText>
              <common:AnnotationText xml:lang="fr">70</common:AnnotationText>
            </common:Annotation>
          </common:Annotations>
          <common:Name xml:lang="en">Multi-domain</common:Name>
          <common:Name xml:lang="fr">Multi-domaine</common:Name>
        </structure:Category>
      </structure:CategoryScheme>
    </structure:CategorySchemes>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

## Get codelists

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/codelist/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves the codelists associated with a dataflow.

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. <code>SPC</code>).<br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| resourceID | string | <p>The ID of the artefact to be returned.<br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>).<br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| version    | string | <p>The version of the artefact to be returned.<br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>).<br>The keyword <code>all</code> can be used to return all version of the matching resource.<br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned. Possible values are: <br><code>none</code>: No references will be returned parents: Returns the artefacts that use the artefact matching the query <br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts<br><code>children</code>: Returns the artefacts referenced by the artefact to be returned<br><code>descendants</code>: References of references, up to any level, will be returned<br><code>all</code>: The combination of parentsandsiblings and descendants In addition, a concrete type of resource may also be used (e.g. codelist)</p>                                                                                                                                                                                                                                                                                                                                                                                                                         |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value.<br>Possible values are:<br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to true<br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information<br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information<br><code>full</code>: All available information for all artefacts should be returned</p> |

{% tabs %}
{% tab title="200 An example API request for the codelist for units of measure (CL\_COM\_UNIT\_MEASURE) (returned as XML): curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/codelist/SPC/CL_COM_UNIT_MEASURE>"" %}

```markup
Date: Fri, 16 Oct 2020 10:46:51 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d0b3b57cd40f3e51c8b6a36f754e8add81602845211; expires=Sun, 15-Nov-20 10:46:51 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e3132ca49a9e9b3-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d29e126e0000e9b3a631c000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11312</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T10:46:51.3717248+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:Codelists>
      <structure:Codelist id="CL_COM_UNIT_MEASURE" agencyID="SPC" version="1.0" isFinal="false">
        <common:Name xml:lang="en">Common codelist for units of measure</common:Name>
        <common:Name xml:lang="fr">Liste de codes commune pour les unités de mesure</common:Name>
        <structure:Code id="N">
          <common:Name xml:lang="en">units</common:Name>
          <common:Name xml:lang="fr">unités</common:Name>
        </structure:Code>
        <structure:Code id="PERCENT">
          <common:Name xml:lang="en">percent</common:Name>
          <common:Name xml:lang="fr">pourcents</common:Name>
        </structure:Code>
        <structure:Code id="KM2">
          <common:Name xml:lang="en">square kilometre</common:Name>
          <common:Name xml:lang="fr">kilomètre carré</common:Name>
        </structure:Code>
        <structure:Code id="POP_KM2">
          <common:Name xml:lang="en">persons per square kilometre</common:Name>
          <common:Name xml:lang="fr">personnes par kilomètre carré</common:Name>
        </structure:Code>
        <structure:Code id="RATIO_POP">
          <common:Name xml:lang="en">ratio to total population</common:Name>
          <common:Name xml:lang="fr">rapport à la population totale</common:Name>
        </structure:Code>
        <structure:Code id="INDEX">
          <common:Name xml:lang="en">index</common:Name>
          <common:Name xml:lang="fr">indice</common:Name>
        </structure:Code>
        <structure:Code id="PER_100000_LIVE_BIRTHS">
          <common:Name xml:lang="en">per 100,000 live births</common:Name>
          <common:Name xml:lang="fr">pour 100 000 naissances vivantes</common:Name>
        </structure:Code>
        <structure:Code id="PER_100000_POP">
          <common:Name xml:lang="en">per 100,000 population</common:Name>
          <common:Name xml:lang="fr">pour 100 000 habitants</common:Name>
        </structure:Code>
        <structure:Code id="PER_1000_POP">
          <common:Name xml:lang="en">per 1,000 population</common:Name>
          <common:Name xml:lang="fr">pour 1000 habitants</common:Name>
        </structure:Code>
        <structure:Code id="LITRES_PURE_ALCOHOL">
          <common:Name xml:lang="en">litres pure alcohol</common:Name>
          <common:Name xml:lang="fr">litres d'alcool pur</common:Name>
        </structure:Code>
        <structure:Code id="PER_100_POP">
          <common:Name xml:lang="en">per 100 population</common:Name>
          <common:Name xml:lang="fr">pour 100 habitants</common:Name>
        </structure:Code>
        <structure:Code id="USD_MILLIONS">
          <common:Name xml:lang="en">usd in millions</common:Name>
          <common:Name xml:lang="fr">usd en millions</common:Name>
        </structure:Code>
        <structure:Code id="USD">
          <common:Name xml:lang="en">USD</common:Name>
          <common:Name xml:lang="fr">USD</common:Name>
        </structure:Code>
        <structure:Code id="T">
          <common:Name xml:lang="en">metric tons</common:Name>
          <common:Name xml:lang="fr">tonnes métriques</common:Name>
        </structure:Code>
        <structure:Code id="CUR_LCU">
          <common:Name xml:lang="en">local currency</common:Name>
          <common:Name xml:lang="fr">monnaie locale</common:Name>
        </structure:Code>
        <structure:Code id="USDBBL">
          <common:Name xml:lang="en">$/bbl</common:Name>
          <common:Name xml:lang="fr">$/bbl</common:Name>
        </structure:Code>
        <structure:Code id="USDMT">
          <common:Name xml:lang="en">$/mt</common:Name>
          <common:Name xml:lang="fr">$/mt</common:Name>
        </structure:Code>
        <structure:Code id="USDMMBTU">
          <common:Name xml:lang="en">$/mmbtu</common:Name>
          <common:Name xml:lang="fr">$/mmbtu</common:Name>
        </structure:Code>
        <structure:Code id="BASE2010">
          <common:Name xml:lang="en">2010=100</common:Name>
          <common:Name xml:lang="fr">2010=100</common:Name>
        </structure:Code>
        <structure:Code id="USDKG">
          <common:Name xml:lang="en">$/kg</common:Name>
          <common:Name xml:lang="fr">$/kg</common:Name>
        </structure:Code>
        <structure:Code id="USDCM">
          <common:Name xml:lang="en">$/cubic meter</common:Name>
          <common:Name xml:lang="fr">$/cubic meter</common:Name>
        </structure:Code>
        <structure:Code id="USHSHEET">
          <common:Name xml:lang="en">¢/sheet</common:Name>
          <common:Name xml:lang="fr">¢/sheet</common:Name>
        </structure:Code>
        <structure:Code id="USDDMTU">
          <common:Name xml:lang="en">$/dmtu</common:Name>
          <common:Name xml:lang="fr">$/dmtu</common:Name>
        </structure:Code>
        <structure:Code id="USDTROYOZ">
          <common:Name xml:lang="en">$/troy oz</common:Name>
          <common:Name xml:lang="fr">$/troy oz</common:Name>
        </structure:Code>
        <structure:Code id="BASE2005">
          <common:Name xml:lang="en">2005=100</common:Name>
          <common:Name xml:lang="fr">2005=100</common:Name>
        </structure:Code>
        <structure:Code id="CENTSKG">
          <common:Name xml:lang="en">cents/kg</common:Name>
          <common:Name xml:lang="fr">cents/kg</common:Name>
        </structure:Code>
        <structure:Code id="NZD">
          <common:Name xml:lang="en">New Zealand Dollar</common:Name>
          <common:Name xml:lang="fr">Dollar néo-zélandais</common:Name>
        </structure:Code>
        <structure:Code id="FJD">
          <common:Name xml:lang="en">Fiji Dollar</common:Name>
          <common:Name xml:lang="fr">Dollar fidjien</common:Name>
        </structure:Code>
        <structure:Code id="AUD">
          <common:Name xml:lang="en">Australian Dollar</common:Name>
          <common:Name xml:lang="fr">Dollar australien</common:Name>
        </structure:Code>
        <structure:Code id="XPF">
          <common:Name xml:lang="en">CFP Franc</common:Name>
          <common:Name xml:lang="fr">Franc CFP</common:Name>
        </structure:Code>
        <structure:Code id="PGK">
          <common:Name xml:lang="en">Kina</common:Name>
          <common:Name xml:lang="fr">Kina</common:Name>
        </structure:Code>
        <structure:Code id="SBD">
          <common:Name xml:lang="en">Solomon Islands Dollar</common:Name>
          <common:Name xml:lang="fr">Dollar des Îles Salomon</common:Name>
        </structure:Code>
        <structure:Code id="TOP">
          <common:Name xml:lang="en">Pa’anga</common:Name>
          <common:Name xml:lang="fr">Pa’anga</common:Name>
        </structure:Code>
        <structure:Code id="VUV">
          <common:Name xml:lang="en">Vatu</common:Name>
          <common:Name xml:lang="fr">Vatu</common:Name>
        </structure:Code>
        <structure:Code id="WST">
          <common:Name xml:lang="en">Tala</common:Name>
          <common:Name xml:lang="fr">Tala</common:Name>
        </structure:Code>
        <structure:Code id="USD_POP">
          <common:Name xml:lang="en">USD per person</common:Name>
          <common:Name xml:lang="fr">USD par personne</common:Name>
        </structure:Code>
        <structure:Code id="NZD_POP">
          <common:Name xml:lang="en">New Zealand Dollar per person</common:Name>
          <common:Name xml:lang="fr">Dollar néo-zélandais par personne</common:Name>
        </structure:Code>
        <structure:Code id="FJD_POP">
          <common:Name xml:lang="en">Fiji Dollar per person</common:Name>
          <common:Name xml:lang="fr">Dollar fidjien par personne</common:Name>
        </structure:Code>
        <structure:Code id="AUD_POP">
          <common:Name xml:lang="en">Australian Dollar per person</common:Name>
          <common:Name xml:lang="fr">Dollar australien par personne</common:Name>
        </structure:Code>
        <structure:Code id="XPF_POP">
          <common:Name xml:lang="en">CFP Franc per person</common:Name>
          <common:Name xml:lang="fr">Franc CFP par personne</common:Name>
        </structure:Code>
        <structure:Code id="PGK_POP">
          <common:Name xml:lang="en">Kina per person</common:Name>
          <common:Name xml:lang="fr">Kina par personne</common:Name>
        </structure:Code>
        <structure:Code id="SBD_POP">
          <common:Name xml:lang="en">Solomon Islands Dollar per person</common:Name>
          <common:Name xml:lang="fr">Dollar des Îles Salomon par personne</common:Name>
        </structure:Code>
        <structure:Code id="TOP_POP">
          <common:Name xml:lang="en">Pa’anga per person</common:Name>
          <common:Name xml:lang="fr">Pa’anga par personne</common:Name>
        </structure:Code>
        <structure:Code id="VUV_POP">
          <common:Name xml:lang="en">Vatu per person</common:Name>
          <common:Name xml:lang="fr">Vatu par personne</common:Name>
        </structure:Code>
        <structure:Code id="WST_POP">
          <common:Name xml:lang="en">Tala per person</common:Name>
          <common:Name xml:lang="fr">Tala par personne</common:Name>
        </structure:Code>
        <structure:Code id="GY">
          <common:Name xml:lang="en">Growth Rate, Over 1 Year</common:Name>
          <common:Name xml:lang="fr">Taux de croissance, sur 1 an</common:Name>
        </structure:Code>
        <structure:Code id="USD_R_POP">
          <common:Name xml:lang="en">Per Capita, US $, Exchange Rates Converted</common:Name>
          <common:Name xml:lang="fr">Par habitant, US $, taux de change convertis</common:Name>
        </structure:Code>
        <structure:Code id="PERCENT_GDP">
          <common:Name xml:lang="en">As a % of GDP</common:Name>
          <common:Name xml:lang="fr">En% du PIB</common:Name>
        </structure:Code>
        <structure:Code id="YR">
          <common:Name xml:lang="en">Years</common:Name>
          <common:Name xml:lang="fr">Années</common:Name>
        </structure:Code>
        <structure:Code id="PER_1000_LIVE_BIRTHS">
          <common:Name xml:lang="en">per 1,000 live births</common:Name>
          <common:Name xml:lang="fr">pour 1000 naissances vivantes</common:Name>
        </structure:Code>
        <structure:Code id="RF">
          <common:Name xml:lang="en">Relative frequency (% of total)</common:Name>
          <common:Name xml:lang="fr">Fréquence relative (% du total)</common:Name>
        </structure:Code>
        <structure:Code id="g">
          <common:Name xml:lang="en">g</common:Name>
          <common:Name xml:lang="fr">g</common:Name>
        </structure:Code>
        <structure:Code id="kcal">
          <common:Name xml:lang="en">kcal</common:Name>
          <common:Name xml:lang="fr">kcal</common:Name>
        </structure:Code>
        <structure:Code id="kj">
          <common:Name xml:lang="en">kj</common:Name>
          <common:Name xml:lang="fr">kj</common:Name>
        </structure:Code>
        <structure:Code id="mg">
          <common:Name xml:lang="en">mg</common:Name>
          <common:Name xml:lang="fr">mg</common:Name>
        </structure:Code>
        <structure:Code id="YEAR">
          <common:Name xml:lang="en">years</common:Name>
          <common:Name xml:lang="fr">années</common:Name>
        </structure:Code>
        <structure:Code id="BOOL">
          <common:Name xml:lang="en">Boolean or binary measure</common:Name>
          <common:Name xml:lang="fr">Mesure booléenne ou binaire</common:Name>
        </structure:Code>
        <structure:Code id="CON_USD">
          <common:Name xml:lang="en">Constant USD</common:Name>
          <common:Name xml:lang="fr">USD constant</common:Name>
        </structure:Code>
        <structure:Code id="HA">
          <common:Name xml:lang="en">Hectares</common:Name>
          <common:Name xml:lang="fr">Hectares</common:Name>
        </structure:Code>
        <structure:Code id="MJ_PER_GDP_CON_PPP_USD">
          <common:Name xml:lang="en">Megajoules per USD constant PPP GDP</common:Name>
          <common:Name xml:lang="fr">Mégajoules par USD PIB PPA constant</common:Name>
        </structure:Code>
        <structure:Code id="PER_10000_POP">
          <common:Name xml:lang="en">per 10,000 population</common:Name>
          <common:Name xml:lang="fr">pour 10 000 habitants</common:Name>
        </structure:Code>
      </structure:Codelist>
    </structure:Codelists>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

## Get concept schemes

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/conceptscheme/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves information about concept schemes used by dataflows.

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. <code>SPC</code>).<br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| resourceID | string | <p>The ID of the artefact to be returned.<br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>).<br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| version    | string | <p>The version of the artefact to be returned.<br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>).<br>The keyword <code>all</code> can be used to return all version of the matching resource.<br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned. <br>Possible values are:<br><code>none</code>: No references will be returned<br><code>parents</code>: Returns the artefacts that use the artefact matching the query<br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts<br><code>children</code>: Returns the artefacts referenced by the artefact to be returned<br><code>descendants</code>: References of references, up to any level, will be returned<br><code>all</code>: The combination of parentsandsiblings and descendants In addition, a concrete type of resource may also be used (e.g. codelist)</p>                                                                                                                                                                                                                                                                                                                                                                                                       |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value.<br>Possible values are:<br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to true<br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information<br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information<br><code>full</code>: All available information for all artefacts should be returned</p> |

{% tabs %}
{% tab title="200 An example API request for common SPC concepts (CS\_COMMON) (returned as XML): curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/conceptscheme/SPC/CS_COMMON>"" %}

```markup
Date: Fri, 16 Oct 2020 10:50:17 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d41d0f238e6803e89c514864a5c216f701602845417; expires=Sun, 15-Nov-20 10:50:17 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e3137d138e732a0-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d2a136c5000032a0f187d000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11315</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T10:50:17.3118345+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:Concepts>
      <structure:ConceptScheme id="CS_COMMON" agencyID="SPC" version="2.0" isFinal="false">
        <common:Name xml:lang="en">Common concepts for SPC .Stat data</common:Name>
        <common:Name xml:lang="fr">Concepts communs pour les données .Stat de la CPS</common:Name>
        <structure:Concept id="TIME_PERIOD">
          <common:Name xml:lang="en">Time</common:Name>
          <common:Name xml:lang="fr">Période</common:Name>
        </structure:Concept>
        <structure:Concept id="FREQ">
          <common:Name xml:lang="en">Frequency</common:Name>
          <common:Name xml:lang="fr">Fréquence</common:Name>
        </structure:Concept>
        <structure:Concept id="OBS_VALUE">
          <common:Name xml:lang="en">Observation value</common:Name>
          <common:Name xml:lang="fr">Valeur observée</common:Name>
        </structure:Concept>
        <structure:Concept id="OBS_SATUS">
          <common:Name xml:lang="en">Observation Status</common:Name>
          <common:Name xml:lang="fr">Statut de l'observation</common:Name>
        </structure:Concept>
        <structure:Concept id="CONF_STATUS">
          <common:Name xml:lang="en">Confidentiality status</common:Name>
          <common:Name xml:lang="fr">Confidentialité</common:Name>
        </structure:Concept>
        <structure:Concept id="UNIT_MEASURE">
          <common:Name xml:lang="en">Unit of measure</common:Name>
          <common:Name xml:lang="fr">Unité de mesure</common:Name>
        </structure:Concept>
        <structure:Concept id="UNIT_MULT">
          <common:Name xml:lang="en">Unit multiplier</common:Name>
          <common:Name xml:lang="fr">Multiplicateur d'unités</common:Name>
        </structure:Concept>
        <structure:Concept id="COMMENT">
          <common:Name xml:lang="en">Comment</common:Name>
          <common:Name xml:lang="fr">Commentaire</common:Name>
        </structure:Concept>
        <structure:Concept id="DECIMALS">
          <common:Name xml:lang="en">Decimals</common:Name>
          <common:Name xml:lang="fr">Décimales</common:Name>
        </structure:Concept>
        <structure:Concept id="GEO_AREA">
          <common:Name xml:lang="en">Geographical area</common:Name>
          <common:Name xml:lang="fr">Zone géographique</common:Name>
        </structure:Concept>
        <structure:Concept id="GEO_PICT">
          <common:Name xml:lang="en">Pacific Island Countries and territories</common:Name>
          <common:Name xml:lang="fr">Pays et territoires insulaires du Pacifique</common:Name>
        </structure:Concept>
        <structure:Concept id="SEX">
          <common:Name xml:lang="en">Sex</common:Name>
          <common:Name xml:lang="fr">Sexe</common:Name>
        </structure:Concept>
        <structure:Concept id="AGE">
          <common:Name xml:lang="en">Age</common:Name>
          <common:Name xml:lang="fr">Âge</common:Name>
        </structure:Concept>
        <structure:Concept id="CURRENCY">
          <common:Name xml:lang="en">Currency</common:Name>
          <common:Name xml:lang="fr">Devise</common:Name>
        </structure:Concept>
        <structure:Concept id="DATA_SOURCE">
          <common:Name xml:lang="en">Data source</common:Name>
          <common:Name xml:lang="fr">Source de données</common:Name>
        </structure:Concept>
        <structure:Concept id="INDICATOR">
          <common:Name xml:lang="en">Indicator</common:Name>
          <common:Name xml:lang="fr">Indicateur</common:Name>
        </structure:Concept>
        <structure:Concept id="COMMODITY">
          <common:Name xml:lang="en">Commodity</common:Name>
          <common:Name xml:lang="fr">Marchandise</common:Name>
        </structure:Concept>
        <structure:Concept id="URBANIZATION">
          <common:Name xml:lang="en">Urbanization</common:Name>
          <common:Name xml:lang="fr">Urbanisation</common:Name>
        </structure:Concept>
        <structure:Concept id="EDUCATION">
          <common:Name xml:lang="en">Education level</common:Name>
          <common:Name xml:lang="fr">Niveau d'éducation</common:Name>
        </structure:Concept>
        <structure:Concept id="OCCUPATION">
          <common:Name xml:lang="en">Occupation</common:Name>
          <common:Name xml:lang="fr">Profession</common:Name>
        </structure:Concept>
        <structure:Concept id="DISABILITY">
          <common:Name xml:lang="en">Disability</common:Name>
          <common:Name xml:lang="fr">Invalidité</common:Name>
        </structure:Concept>
        <structure:Concept id="INCOME">
          <common:Name xml:lang="en">Income</common:Name>
          <common:Name xml:lang="fr">Revenu</common:Name>
        </structure:Concept>
        <structure:Concept id="COMPOSITE_BREAKDOWN">
          <common:Name xml:lang="en">Composite breakdown</common:Name>
          <common:Name xml:lang="fr">Ventilation composite</common:Name>
        </structure:Concept>
        <structure:Concept id="ECONOMIC_SECTOR">
          <common:Name xml:lang="en">Economic sector</common:Name>
          <common:Name xml:lang="fr">Secteur économique</common:Name>
        </structure:Concept>
        <structure:Concept id="LABOUR_FORCE_STATUS">
          <common:Name xml:lang="en">Labour force status</common:Name>
          <common:Name xml:lang="fr">Statut d'activité professionnelle</common:Name>
        </structure:Concept>
        <structure:Concept id="EMPLOYMENT_STATUS">
          <common:Name xml:lang="en">Employment status</common:Name>
          <common:Name xml:lang="fr">Statut d'emploi</common:Name>
        </structure:Concept>
        <structure:Concept id="BASE_PER">
          <common:Name xml:lang="en">Base period</common:Name>
          <common:Name xml:lang="fr">Période de base</common:Name>
        </structure:Concept>
        <structure:Concept id="TIME_FORMAT">
          <common:Name xml:lang="en">Time format</common:Name>
          <common:Name xml:lang="fr">Format termporel</common:Name>
        </structure:Concept>
        <structure:Concept id="LABEMP_STATUS">
          <common:Name xml:lang="en">Labour and employment status</common:Name>
          <common:Name xml:lang="fr">Statut d'activité professionnelle et d'emploi</common:Name>
        </structure:Concept>
        <structure:Concept id="BUDGET">
          <common:Name xml:lang="en">Budget</common:Name>
          <common:Name xml:lang="fr">Budget</common:Name>
        </structure:Concept>
      </structure:ConceptScheme>
    </structure:Concepts>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

## Get content constraints

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/contentconstraint/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves content constraints for a dataflow.

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. <code>SPC</code>).<br>It is possible to set more than one agency, using <code>+</code> as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| resourceID | string | <p>The ID of the artefact to be returned.<br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>).<br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| version    | string | <p>The version of the artefact to be returned.<br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>).<br>The keyword <code>all</code> can be used to return all version of the matching resource.<br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned. <br>Possible values are:<br><code>none</code>: No references will be returned parents: Returns the artefacts that use the artefact matching the query <br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts<br><code>children</code>: Returns the artefacts referenced by the artefact to be returned<br><code>descendants</code>: References of references, up to any level, will be returned<br><code>all</code>: The combination of parentsandsiblings and descendants In addition, a concrete type of resource may also be used (e.g. codelist)</p>                                                                                                                                                                                                                                                                                                                                                                                                                      |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value.<br>Possible values are:<br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to true<br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information<br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information<br><code>full</code>: All available information for all artefacts should be returned</p> |

{% tabs %}
{% tab title="200 An example API request for the list of constraints for the NMDI dataflow (CON\_NMDI) (returned as XML): curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/contentconstraint/SPC/CON_NMDI>"" %}

```markup
Date: Fri, 16 Oct 2020 10:54:45 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d5897a1c29f59bca34e2c0f1fff906f991602845685; expires=Sun, 15-Nov-20 10:54:45 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e313e5dfbfd32a5-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d2a54ebf000032a5ce1e2000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11318</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T10:54:45.5537897+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:Constraints>
      <structure:ContentConstraint id="CON_NMDI" agencyID="SPC" version="1.0" isFinal="false" type="Allowed">
        <common:Name xml:lang="en">Consraint in list of indicators for NMDI</common:Name>
        <structure:ConstraintAttachment>
          <structure:Dataflow>
            <Ref id="DF_NMDI" version="1.0" agencyID="SPC" package="datastructure" class="Dataflow" />
          </structure:Dataflow>
        </structure:ConstraintAttachment>
        <structure:CubeRegion include="true">
          <common:KeyValue id="GEO_PICT">
            <common:Value>AS</common:Value>
            <common:Value>CK</common:Value>
            <common:Value>FJ</common:Value>
            <common:Value>FM</common:Value>
            <common:Value>GU</common:Value>
            <common:Value>KI</common:Value>
            <common:Value>MH</common:Value>
            <common:Value>MP</common:Value>
            <common:Value>NC</common:Value>
            <common:Value>NR</common:Value>
            <common:Value>NU</common:Value>
            <common:Value>PF</common:Value>
            <common:Value>PG</common:Value>
            <common:Value>PN</common:Value>
            <common:Value>PW</common:Value>
            <common:Value>SB</common:Value>
            <common:Value>TK</common:Value>
            <common:Value>TO</common:Value>
            <common:Value>TV</common:Value>
            <common:Value>VU</common:Value>
            <common:Value>WF</common:Value>
            <common:Value>WS</common:Value>
          </common:KeyValue>
          <common:KeyValue id="INDICATOR">
            <common:Value>AG_LND_FRST</common:Value>
            <common:Value>AG_PRD_ORTIND</common:Value>
            <common:Value>BX_TRF_PWKR</common:Value>
            <common:Value>DC_FTA_TOTAL</common:Value>
            <common:Value>DC_ODA_LDCG</common:Value>
            <common:Value>DC_TOF_INFRAL</common:Value>
            <common:Value>DC_TOF_TRDCMDL</common:Value>
            <common:Value>DC_TRF_TOTDL</common:Value>
            <common:Value>DEV</common:Value>
            <common:Value>DT_TDS_DECT</common:Value>
            <common:Value>EDU</common:Value>
            <common:Value>EG_ACS_ELEC</common:Value>
            <common:Value>EG_FEC_RNEW</common:Value>
            <common:Value>EN_LND_SLUM</common:Value>
            <common:Value>EN_REF_COLDIS</common:Value>
            <common:Value>ER_CBD_ABSCLRHS</common:Value>
            <common:Value>ER_GRF_ANIMKPT</common:Value>
            <common:Value>ER_H2O_FISHFEXP</common:Value>
            <common:Value>ER_MRN_MARIN</common:Value>
            <common:Value>ER_PTD_FRHWTR</common:Value>
            <common:Value>ER_PTD_TERR</common:Value>
            <common:Value>ER_PTD_TOT</common:Value>
            <common:Value>ER_RSK_LST</common:Value>
            <common:Value>FB_BNK_ACCSS</common:Value>
            <common:Value>FIS</common:Value>
            <common:Value>HEA</common:Value>
            <common:Value>IC_GEN_MGTL</common:Value>
            <common:Value>INF</common:Value>
            <common:Value>IT_MOB_2GNTWK</common:Value>
            <common:Value>IT_MOB_OWN</common:Value>
            <common:Value>IT_NET_BBND</common:Value>
            <common:Value>IT_USE_ii99</common:Value>
            <common:Value>NMDI0001</common:Value>
            <common:Value>NMDI0002</common:Value>
            <common:Value>NMDI0003</common:Value>
            <common:Value>NMDI0004</common:Value>
            <common:Value>NMDI0011</common:Value>
            <common:Value>NMDI0013</common:Value>
            <common:Value>NMDI0014</common:Value>
            <common:Value>NMDI0016</common:Value>
            <common:Value>NMDI0018</common:Value>
            <common:Value>NMDI0019</common:Value>
            <common:Value>NMDI0020</common:Value>
            <common:Value>NMDI0021</common:Value>
            <common:Value>NMDI0022</common:Value>
            <common:Value>NMDI0033</common:Value>
            <common:Value>NMDI0034</common:Value>
            <common:Value>NMDI0035</common:Value>
            <common:Value>NMDI0036</common:Value>
            <common:Value>NMDI0038</common:Value>
            <common:Value>NMDI0047</common:Value>
            <common:Value>NMDI0051</common:Value>
            <common:Value>NMDI0052</common:Value>
            <common:Value>NMDI0054</common:Value>
            <common:Value>NMDI0057</common:Value>
            <common:Value>NMDI0059</common:Value>
            <common:Value>NMDI0081</common:Value>
            <common:Value>NMDI0087</common:Value>
            <common:Value>NMDI0088</common:Value>
            <common:Value>NMDI0091</common:Value>
            <common:Value>NMDI0099</common:Value>
            <common:Value>NMDI0100</common:Value>
            <common:Value>NMDI0102</common:Value>
            <common:Value>NMDI0103</common:Value>
            <common:Value>NMDI0116</common:Value>
            <common:Value>NMDI0118</common:Value>
            <common:Value>NMDI0129</common:Value>
            <common:Value>NMDI0131</common:Value>
            <common:Value>NMDI0132</common:Value>
            <common:Value>NMDI0133</common:Value>
            <common:Value>NMDI0134</common:Value>
            <common:Value>NMDI0137</common:Value>
            <common:Value>NMDI0138</common:Value>
            <common:Value>NMDI0139</common:Value>
            <common:Value>NMDI0145</common:Value>
            <common:Value>NMDI0146</common:Value>
            <common:Value>NMDI0149</common:Value>
            <common:Value>NMDI0165</common:Value>
            <common:Value>NMDI0167</common:Value>
            <common:Value>NMDI0193</common:Value>
            <common:Value>NMDI0225</common:Value>
            <common:Value>NMDI0226</common:Value>
            <common:Value>NMDI0264</common:Value>
            <common:Value>NMDI0265</common:Value>
            <common:Value>NMDI0293</common:Value>
            <common:Value>NMDI0294</common:Value>
            <common:Value>NMDI0295</common:Value>
            <common:Value>NMDI0296</common:Value>
            <common:Value>NMDI0303</common:Value>
            <common:Value>NMDI0419</common:Value>
            <common:Value>NMDI0420</common:Value>
            <common:Value>NMDI0421</common:Value>
            <common:Value>NMDI0426</common:Value>
            <common:Value>NMDI0428</common:Value>
            <common:Value>NMDI0429</common:Value>
            <common:Value>NMDI0431</common:Value>
            <common:Value>NY_GDP_PCAP</common:Value>
            <common:Value>OTH</common:Value>
            <common:Value>POP</common:Value>
            <common:Value>SE_ACS_ELECT</common:Value>
            <common:Value>SE_ADT_EDUCTRN</common:Value>
            <common:Value>SE_GC_TCAQ</common:Value>
            <common:Value>SE_PRE_PARTN</common:Value>
            <common:Value>SE_TOT_GPI</common:Value>
            <common:Value>SE_TOT_PRFL</common:Value>
            <common:Value>SG_DSR_LEGREG</common:Value>
            <common:Value>SG_GEN_PARL</common:Value>
            <common:Value>SG_HAZ_CMRBASEL</common:Value>
            <common:Value>SG_INF_ACCSS</common:Value>
            <common:Value>SG_INT_MBR</common:Value>
            <common:Value>SG_PLN_MSTKSDG</common:Value>
            <common:Value>SG_PLN_PRVNDI</common:Value>
            <common:Value>SG_REG_BRTH</common:Value>
            <common:Value>SG_REG_BRTH90</common:Value>
            <common:Value>SG_STT_CAPTY</common:Value>
            <common:Value>SG_STT_FPOS</common:Value>
            <common:Value>SG_STT_NSDSFDDNR</common:Value>
            <common:Value>SH_ALC_CONSPT</common:Value>
            <common:Value>SH_DTH_NCD</common:Value>
            <common:Value>SH_DYN_IMRT</common:Value>
            <common:Value>SH_DYN_NMRT</common:Value>
            <common:Value>SH_FPL_INFM</common:Value>
            <common:Value>SH_FPL_MTMM</common:Value>
            <common:Value>SH_H2O_SAFE</common:Value>
            <common:Value>SH_IHR_CAPPRD</common:Value>
            <common:Value>SH_MED_DEN</common:Value>
            <common:Value>SH_PRV_SMOK</common:Value>
            <common:Value>SH_SAN_DEFECT</common:Value>
            <common:Value>SH_STA_BRTC</common:Value>
            <common:Value>SH_STA_MALR</common:Value>
            <common:Value>SH_STA_MORT</common:Value>
            <common:Value>SH_STA_STNT</common:Value>
            <common:Value>SH_STA_WASH</common:Value>
            <common:Value>SH_STA_WAST</common:Value>
            <common:Value>SH_TBS_INCD</common:Value>
            <common:Value>SH_TRP_INTVN</common:Value>
            <common:Value>SI_COV_BENFTS</common:Value>
            <common:Value>SI_HEI_TOTL</common:Value>
            <common:Value>SI_POV_DAY1</common:Value>
            <common:Value>SI_POV_NAHC</common:Value>
            <common:Value>SI_RMT_COST</common:Value>
            <common:Value>SL_DOM_TSPD</common:Value>
            <common:Value>SL_EMP_EARN</common:Value>
            <common:Value>SL_EMP_GTOTL</common:Value>
            <common:Value>SL_ISV_IFRM</common:Value>
            <common:Value>SL_TLF_MANF</common:Value>
            <common:Value>SL_TLF_NEET</common:Value>
            <common:Value>SL_TLF_UEM</common:Value>
            <common:Value>SN_ITK_DEFC</common:Value>
            <common:Value>SP_DYN_ADKL</common:Value>
            <common:Value>SP_DYN_MRBF</common:Value>
            <common:Value>SPC_1_2_2</common:Value>
            <common:Value>SPC_1_4_1</common:Value>
            <common:Value>SPC_10_2_1</common:Value>
            <common:Value>SPC_10_7_2</common:Value>
            <common:Value>SPC_11_b_2</common:Value>
            <common:Value>SPC_12_4_2</common:Value>
            <common:Value>SPC_12_5_1</common:Value>
            <common:Value>SPC_12_b_1</common:Value>
            <common:Value>SPC_13_2_1</common:Value>
            <common:Value>SPC_13_3_1</common:Value>
            <common:Value>SPC_13_a_1</common:Value>
            <common:Value>SPC_13_b_1</common:Value>
            <common:Value>SPC_14_1_1</common:Value>
            <common:Value>SPC_14_2_1</common:Value>
            <common:Value>SPC_14_3_1</common:Value>
            <common:Value>SPC_14_6_1</common:Value>
            <common:Value>SPC_14_7_1</common:Value>
            <common:Value>SPC_14_a_1</common:Value>
            <common:Value>SPC_14_b_1</common:Value>
            <common:Value>SPC_15_7_1</common:Value>
            <common:Value>SPC_15_8_1</common:Value>
            <common:Value>SPC_16_1_3</common:Value>
            <common:Value>SPC_16_3_1</common:Value>
            <common:Value>SPC_16_6_1</common:Value>
            <common:Value>SPC_16_7_1</common:Value>
            <common:Value>SPC_16_7_2</common:Value>
            <common:Value>SPC_17_1_1</common:Value>
            <common:Value>SPC_17_1_2</common:Value>
            <common:Value>SPC_17_14_1</common:Value>
            <common:Value>SPC_17_17_1</common:Value>
            <common:Value>SPC_17_3_1</common:Value>
            <common:Value>SPC_17_7_1</common:Value>
            <common:Value>SPC_2_3_2</common:Value>
            <common:Value>SPC_2_4_1</common:Value>
            <common:Value>SPC_3_8_1</common:Value>
            <common:Value>SPC_4_6_1</common:Value>
            <common:Value>SPC_4_7_1</common:Value>
            <common:Value>SPC_5_1_1</common:Value>
            <common:Value>SPC_5_2_2</common:Value>
            <common:Value>SPC_5_a_2</common:Value>
            <common:Value>SPC_5_c_1</common:Value>
            <common:Value>SPC_6_3_1</common:Value>
            <common:Value>SPC_7_a_1</common:Value>
            <common:Value>SPC_8_9_1</common:Value>
            <common:Value>SPC_8_9_2</common:Value>
            <common:Value>VC_DSR_AALG</common:Value>
            <common:Value>VC_DSR_AFFCT</common:Value>
            <common:Value>VC_DSR_MISS</common:Value>
            <common:Value>VC_DSR_MORT</common:Value>
            <common:Value>VC_VAW_MARR</common:Value>
          </common:KeyValue>
        </structure:CubeRegion>
      </structure:ContentConstraint>
    </structure:Constraints>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

## Get data structures

<mark style="color:blue;">`GET`</mark> `https://stats-nsi-stable.pacificdata.org/rest/datastructure/{agencyID}/{resourceID}/{version}[?references][&detail]`

This method retrieves a data structure definition.

#### Path Parameters

| Name       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agencyID   | string | <p>The agency maintaining the artefact to be returned (i.e. <code>SPC</code>).<br>It is possible to set more than one agency, using + as separator (e.g. <code>SPC+ECB</code>).<br>The keyword <code>all</code> can be used to indicate that artefacts maintained by any maintenance agency should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| resourceID | string | <p>The ID of the artefact to be returned.<br>It is possible to set more than one ID, using <code>+</code> as separator (e.g. <code>CL\_FREQ+CL\_CONF\_STATUS</code>).<br>The keyword <code>all</code> can be used to indicate that any artefact of the specified resource type should be returned.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| version    | string | <p>The version of the artefact to be returned.<br>It is possible to set more than one version, using <code>+</code> as separator (e.g. <code>1.0+2.1</code>).<br>The keyword <code>all</code> can be used to return all version of the matching resource.<br>The keyword <code>latest</code> can be used to return the latest production version of the matching resource.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| references | string | <p>Instructs the web service to return (or not return) the artefacts referenced by the artefact to be returned. <br>Possible values are: <br><code>none</code>: No references will be returned<br><code>parents</code>: Returns the artefacts that use the artefact matching the query<br><code>parentsandsiblings</code>: Returns the artefacts that use the artefact matching the query, as well as the artefacts referenced by these artefacts<br><code>children</code>: Returns the artefacts referenced by the artefact to be returned<br><code>descendants</code>: References of references, up to any level, will be returned<br><code>all</code>: The combination of parentsandsiblings and descendants In addition, a concrete type of resource may also be used (e.g. codelist)</p>                                                                                                                                                                                                                                                                                                                                                                                                      |
| detail     | string | <p>The amount of information to be returned. <code>referencepartial</code> is a common value.<br>Possible values are:<br><code>allstubs</code>: All artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencestubs</code>: Referenced artefacts should be returned as stubs, containing only identification information, as well as the artefacts' name<br><code>referencepartial</code>: Referenced item schemes should only include items used by the artefact to be returned. For example, a concept scheme would only contain the concepts used in a DSD, and its isPartial flag would be set to true<br><code>allcompletestubs</code>: All artefacts should be returned as complete stubs, containing identification information, the artefacts' names, descriptions, annotations and isFinal information<br><code>referencecompletestubs</code>: Referenced artefacts should be returned as complete stubs, containing identification information, the artefacts' name, description, annotations and isFinal information<br><code>full</code>: All available information for all artefacts should be returned</p> |

{% tabs %}
{% tab title="200 An example API request for the data structure definition of Commodity Prices (DSD\_COMMODITY\_PRICES) (returned as XML): curl -v -X GET "<https://stats-nsi-stable.pacificdata.org/rest/datastructure/SPC/DSD_COMMODITY_PRICES>"" %}

```markup
Date: Fri, 16 Oct 2020 11:01:34 GMT
Content-Type: application/vnd.sdmx.structure+xml; version=2.1; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d59a104a71be634615a1cf4fac9207a8a1602846094; expires=Sun, 15-Nov-20 11:01:34 GMT; path=/; domain=.pacificdata.org; HttpOnly; SameSite=Lax
CF-Ray: 5e31485aea5432a1-BNE
Accept-Ranges: values
Cache-Control: no-store,no-cache
Vary: Accept, Accept-Encoding
CF-Cache-Status: DYNAMIC
cf-request-id: 05d2ab8cd1000032a1a2306000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Pragma: no-cache
Server: cloudflare

<?xml version="1.0" encoding="utf-8"?>
<!--NSI Web Service v7.13.0.0-->
<message:Structure xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common">
  <message:Header>
    <message:ID>IDREF11321</message:ID>
    <message:Test>false</message:Test>
    <message:Prepared>2020-10-16T11:01:34.6619601+00:00</message:Prepared>
    <message:Sender id="Unknown" />
    <message:Receiver id="Unknown" />
  </message:Header>
  <message:Structures>
    <structure:DataStructures>
      <structure:DataStructure id="DSD_COMMODITY_PRICES" agencyID="SPC" version="1.0" isFinal="false">
        <common:Name xml:lang="en">DSD for commodity prices</common:Name>
        <structure:DataStructureComponents>
          <structure:DimensionList id="DimensionDescriptor">
            <structure:Dimension id="FREQ" position="1">
              <structure:ConceptIdentity>
                <Ref id="FREQ" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
              <structure:LocalRepresentation>
                <structure:Enumeration>
                  <Ref id="CL_COM_FREQ" version="1.0" agencyID="SPC" package="codelist" class="Codelist" />
                </structure:Enumeration>
              </structure:LocalRepresentation>
            </structure:Dimension>
            <structure:Dimension id="COMMODITY" position="2">
              <structure:ConceptIdentity>
                <Ref id="COMMODITY" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
              <structure:LocalRepresentation>
                <structure:Enumeration>
                  <Ref id="CL_COMMODITY_PRICES" version="1.0" agencyID="SPC" package="codelist" class="Codelist" />
                </structure:Enumeration>
              </structure:LocalRepresentation>
            </structure:Dimension>
            <structure:Dimension id="INDICATOR" position="3">
              <structure:ConceptIdentity>
                <Ref id="INDICATOR" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
              <structure:LocalRepresentation>
                <structure:Enumeration>
                  <Ref id="CL_COMMODITY_PRICES_INDICATORS" version="1.0" agencyID="SPC" package="codelist" class="Codelist" />
                </structure:Enumeration>
              </structure:LocalRepresentation>
            </structure:Dimension>
            <structure:TimeDimension id="TIME_PERIOD" position="4">
              <structure:ConceptIdentity>
                <Ref id="TIME_PERIOD" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
              <structure:LocalRepresentation>
                <structure:TextFormat textType="ObservationalTimePeriod" />
              </structure:LocalRepresentation>
            </structure:TimeDimension>
          </structure:DimensionList>
          <structure:AttributeList id="AttributeDescriptor">
            <structure:Attribute id="DATA_SOURCE" assignmentStatus="Conditional">
              <structure:ConceptIdentity>
                <Ref id="DATA_SOURCE" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
              <structure:LocalRepresentation>
                <structure:TextFormat textType="String" />
              </structure:LocalRepresentation>
              <structure:AttributeRelationship>
                <structure:Dimension>
                  <Ref id="FREQ" />
                </structure:Dimension>
                <structure:Dimension>
                  <Ref id="COMMODITY" />
                </structure:Dimension>
                <structure:Dimension>
                  <Ref id="INDICATOR" />
                </structure:Dimension>
              </structure:AttributeRelationship>
            </structure:Attribute>
            <structure:Attribute id="UNIT_MEASURE" assignmentStatus="Conditional">
              <structure:ConceptIdentity>
                <Ref id="UNIT_MEASURE" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
              <structure:LocalRepresentation>
                <structure:Enumeration>
                  <Ref id="CL_COM_UNIT_MEASURE" version="1.0" agencyID="SPC" package="codelist" class="Codelist" />
                </structure:Enumeration>
              </structure:LocalRepresentation>
              <structure:AttributeRelationship>
                <structure:Dimension>
                  <Ref id="COMMODITY" />
                </structure:Dimension>
                <structure:Dimension>
                  <Ref id="INDICATOR" />
                </structure:Dimension>
              </structure:AttributeRelationship>
            </structure:Attribute>
            <structure:Attribute id="OBS_COMMENT" assignmentStatus="Conditional">
              <structure:ConceptIdentity>
                <Ref id="COMMENT" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
              <structure:LocalRepresentation>
                <structure:TextFormat textType="String" />
              </structure:LocalRepresentation>
              <structure:AttributeRelationship>
                <structure:PrimaryMeasure>
                  <Ref id="OBS_VALUE" />
                </structure:PrimaryMeasure>
              </structure:AttributeRelationship>
            </structure:Attribute>
          </structure:AttributeList>
          <structure:MeasureList id="MeasureDescriptor">
            <structure:PrimaryMeasure id="OBS_VALUE">
              <structure:ConceptIdentity>
                <Ref id="OBS_VALUE" maintainableParentID="CS_COMMON" maintainableParentVersion="2.0" agencyID="SPC" package="conceptscheme" class="Concept" />
              </structure:ConceptIdentity>
            </structure:PrimaryMeasure>
          </structure:MeasureList>
        </structure:DataStructureComponents>
      </structure:DataStructure>
    </structure:DataStructures>
  </message:Structures>
</message:Structure>* Connection #0 to host stats-nsi-stable.pacificdata.org left intact
```

{% endtab %}
{% endtabs %}

{% content-ref url="/pages/-MDWr0p-JHJyT6nKvFYe" %}
[Broken mention](broken://pages/-MDWr0p-JHJyT6nKvFYe)
{% endcontent-ref %}


# Use cases

The PDH.stat API is an efficient way of accessing Pacific data for a variety of use cases.

Here we outline a few different types of use cases, so that you can learn how to best leverage the API's functionality for your need.

* [Query building with Data Explorer](/dotstat/api/use-cases#query-building-with-data-explorer)
* [Making a data request](/dotstat/api/use-cases#making-a-data-request)
* [Making a data request for a specific response format](/dotstat/api/use-cases#making-a-data-request-for-a-specific-format)
* [Making a dataflow request (retrieving information on existing datasets)](/dotstat/api/use-cases#discovering-dataflows)

## Query building with Data Explorer

If you're making a "one-off" data request about a certain topic, the [PDH.stat Data Explorer](https://stats.pacificdata.org/data-explorer/#/) may be the easiest way to go about it. The intuitive interface allows you to choose a dataset, adjust filters and view the results in a table or chart. You can then produce the API request URL for the actual SDMX data you've accessed. This makes it useful for API query building and is explained in a [dedicated section of the Data Explorer documentation](/dotstat/de#get-api-queries-corresponding-to-the-data-selection).

## Making a data request

If you're wanting to access specific data for use in a web application, for producing a "live" chart, or for some other reason, you will want to construct an API request.

In general, you will use the `HTTP GET` method with the `data` endpoint to request a dataflow (i.e. dataset). You'll use the API's path and query parameters to define the exact data you want, the time period, the response format, and so on.

The basic template for the API data request URL is defined below.

```
https://stats-nsi-stable.pacificdata.org/rest/data/flowID/key?queryparameters
```

**The key parameter**

The `key` parameter is the primary way of filtering the exact data you're looking for in a dataflow (dataset). The keyword `all` can be used to indicate that all data should be returned. The allowable values for key will change depending on the selected dataflow. In general it is a series of parameters separated by the `.` symbol. Where there are 2 points in a row, it indicates a wildcard for that parameter. To select several values as a parameter, separate them with a `+` sign.

**Note: building the key parameter can be difficult, so the Data Explorer can be used to visually select/filter data, and then see the matching API request URL. This can make key-building much easier. See it** [**here**](https://stats.pacificdata.org/data-explorer/#/)**.**

Examples of `key` parameter for different dataflows:

* `FJ+KI.A`: (Population dataflow) Annual population figures for Fiji and Kiribati
* `AG_LND_TOTL..GU.KM2`: (Pocket Summary dataflow) Land area in kilometres squared in Guam

**Example: Retrieving population data for two countries**

In this example, we want data on population estimates of Fiji and New Caledonia over time (1970 to 2018). The following API request will return the SDMX data we're after:

```
https://stats-nsi-stable.pacificdata.org/rest/data/DF_POP_PROJ/A.NC+FJ...?startPeriod=1970&endPeriod=2018
```

* Path Parameters
* **data** : indicates that we want to access a given "dataflow"
* **DF\_POP\_PROJ** : `flowID` parameter, uniquely identifies the SDMX "dataflow" ("Population Projections" in this case)
* **A.NC+FJ...** : `key` parameter, filters results to get Annual data about New Caledonia (NC) and Fiji (FJ). The points represent "wildcards" for other optional filters (such as sex, age, and type of population indicator), meaning that we will get data on all of those options.
* Query Parameters
* **startPeriod=1970** : `startPeriod` parameter, gets data starting from 1970
* **endPeriod=2018** : `endPeriod` parameter, gets data up until 2018

## **Making a data request for a specific format**

Data requests can specify what the response data format should be: json, csv, SDMX etc. In this example, we will get the same population data as in the above example, but we want the response in a JSON format. The following API request will return the JSON data we're after:

```
https://stats-nsi-stable.pacificdata.org/rest/data/DF_POP_PROJ/A.NC+FJ...?startPeriod=1970&endPeriod=2018&format=jsondata
```

* Path Parameters
* **data** : indicates that we want to access a given "dataflow"
* **DF\_POP\_PROJ** : `flowID` parameter, uniquely identifies the SDMX "dataflow" ("Population Summary" in this case)
* **A.NC+FJ...** : `key` parameter, filters results to get Annual data about New Caledonia (NC) and Fiji (FJ). The points represent "wildcards" for other optional filters (such as sex, age, and type of population indicator), meaning that we will get data on all of those options.
* Query Parameters
* **startPeriod=1970** : `startPeriod` parameter, gets data starting from 1969
* **endPeriod=2018** : `endPeriod` parameter, gets data up until 2018
* **format=jsondata** : `format` parameter, defines the desired response format: jsondata, csv, genericdata etc.

**Sample Code**

For detailed implementations of API use, see [Sample Code](/dotstat/api/scode).

## Discovering dataflows

Depending on your application's needs, you may want to retrieve information on all existing dataflows. The `HTTP GET` method is used with the `dataflow` endpoint to get this type of information.

The basic template for the API dataflow request URL is defined below.

```
https://stats-nsi-stable.pacificdata.org/rest/dataflow/agencyID/resourceID/version?queryparameters
```

**Example: Retrieve all dataflows for a specific agency**

In this example, we want to know all existing dataflows maintained by SPC, and details about those dataflows. The following API request will return the SDMX data we're after:

```
https://stats-nsi-stable.pacificdata.org/rest/dataflow/SPC/all/latest?detail=full
```

* Path Parameters
* **dataflow** : indicates that we want information on dataflows
* **SPC** : `agencyID` parameter, uniquely identifies the agency whose dataflows we want to request
* **all** : `resourceID` parameter, retrieves 'all' resources
* **latest** : `version` parameter, gets the latest version of the resource
* Query Parameters
* **detail=full** : `detail` parameter, determines what sort of information about resources is returned

**Sample Code**

For example code which retrieves all dataflowIds, see [Sample Code](/dotstat/api/scode).


# Sample code

Here are some worked examples of the PDH.stat API being used for various reasons. Full details of each implementation are available in the provided Github links.

Many of these tasks can be simplified through the PDH.stat API's suite of [plugins](/dotstat/plugins).

## **Get all dataflow IDs from PDH.stat API**

This Python script returns a list of all existing dataflowIDs. This can be useful for applications which need to check for new/updated dataflows.

```python
import requests
from bs4 import BeautifulSoup

base_url = 'https://stats-nsi-stable.pacificdata.org/rest/'

def get_endpoints(base_url):
  """
  Get the dataflowIDs of all existing dataflows in PDH .Stat API
        :param base_url: the API's base URL
        :return: list of strings
  """
  endpoints = []
  resources_url = base_url + 'dataflow/all/all/latest?detail=full'
  resp = requests.get(resources_url, verify=False)
  soup = BeautifulSoup(resp.text, 'xml')
  for name in soup.findAll('Dataflow'):
    endpoints.append(name['id'])
  return endpoints

df_ids = get_endpoints(base_url)
print(df_ids)

# Output: ['DF_COMMODITY_PRICES', 'DF_CPI', 'DF_CURRENCIES', 'DF_EMPLOYED', 'DF_EMPRATES', 'DF_GFS', 'DF_HHEXP', 'DF_IMTS', 'DF_LABEMP', 'DF_NATIONAL_ACCOUNTS', 'DF_NEET', 'DF_NMDI', 'DF_NMDI_DEV', 'DF_NMDI_EDU', 'DF_NMDI_FIS', 'DF_NMDI_HEA', 'DF_NMDI_INF', 'DF_NMDI_OTH', 'DF_NMDI_POP', 'DF_OVERSEAS_VISITORS', 'DF_POCKET', 'DF_POP_COAST', 'DF_POP_DENSITY', 'DF_POP_PROJ', 'DF_SDG', 'DF_SDG_01', 'DF_SDG_02', 'DF_SDG_03', 'DF_SDG_04', 'DF_SDG_05', 'DF_SDG_06', 'DF_SDG_07', 'DF_SDG_08', 'DF_SDG_09', 'DF_SDG_10', 'DF_SDG_11', 'DF_SDG_12', 'DF_SDG_13', 'DF_SDG_14', 'DF_SDG_15', 'DF_SDG_16', 'DF_SDG_17', 'DF_UIS', 'DF_VITAL']
```

## **Get basic metadata about a dataflow from PDH.stat API**

This Python script returns a dictionary with the title, agencyId, version for a given dataflowId. This can be useful for applications which harvest from PDH.stat or simply need to display information about a dataset/dataflow. The function can be used iteratively for information on more than one dataflow.

```python
import requests
from bs4 import BeautifulSoup

base_url = 'https://stats-nsi-stable.pacificdata.org/rest/'
df = str(input('Enter dataflow ID: '))
# Or hard-code an example dataflow
# df = 'DF_SDG'

def basic_metadata(base_url, df):
  """
  Get some basic metadata on a dataflow in PDH .Stat API
        :param base_url: the API's base URL (string)
        :param df: the dataflow ID (string) e.g. 'DF_SDG'
        :return: dictionary of metadata key, value pairs
  """
  meta_suffix = 'latest/?references=all&detail=referencepartial'
  meta_url = '{}dataflow/all/{}/{}'.format(base_url, df, meta_suffix)
  meta = requests.get(meta_url, verify=False)
  soup = BeautifulSoup(meta.text, 'xml')
  structure = soup.find('Dataflow', attrs= {'id': df})
  meta_dict = {'dataflowId' : df}
  meta_dict['title'] = structure.find('Name').text
  meta_dict['agencyId'] = structure['agencyID']
  meta_dict['version'] = structure['version']
  return meta_dict

dict = basic_metadata(base_url, df)
print(dict)

# Output (assuming :param df is 'DF_SDG')
# {'dataflowId': 'DF_SDG', 'title': 'Sustainable Development Goals (all)', 'agencyId': 'SPC', 'version': '3.0'}
```

## **Plot time series population data using the Python plugin with PDH .Stat API**

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKO5oMjrXHknW_VLC0-%2F-MKO7IgOyc5KHJajwQyI%2Fpopulation_snippet.png?alt=media\&token=fe7ae77e-5fd6-4e2a-aaae-47731fa5ae8d)

This Python script demonstrates how the API can be accessed with the [Python sdmx plugin](/dotstat/plugins/python). It makes a request for a filtered dataset of population projections for a specified number of countries. It then plots the results as a time series chart. It could be adapted to handle different countries, different time frames and other time series data too.

```python
import pandas as pd
import matplotlib.pyplot as plt
import sdmx

# Set SPC as the Client 
spc = sdmx.Client('SPC')

# Design key to fetch mid-year population estimates for New Caledonia, Fiji and American Samoa
# Sex and Age are set to _T which represents total/all
key = dict(GEO_PICT=['NC', 'FJ', 'AS'], INDICATOR='MIDYEARPOPEST', SEX='_T', AGE='_T')

# Set parameters to get data from 1970 to 2010
params = dict(startPeriod='1970', endPeriod='2010')

# Make the data request and pass the key and parameters
data = spc.data('DF_POP_PROJ', key=key, params=params)

# Load as dataframe
df = sdmx.to_pandas(data)
df = df.reset_index()

# Replace country codes with real names
df['GEO_PICT'] = df['GEO_PICT'].replace({'NC':'New Caledonia', 'AS': 'American Samoa', 'FJ': 'Fiji'})

# Group by country and plot the data as line charts
fig, ax = plt.subplots()
for key, grp in df.groupby(['GEO_PICT']):
    ax = grp.plot(ax=ax, kind='line', x='TIME_PERIOD', y='value', label=key)
plt.title('Population estimates 1970 to 2010')
plt.xlabel('Year')
plt.ylabel('Population')
plt.legend(loc='best')
plt.show()
```


# Microdata Library

A gateway to the Pacific region’s survey, census, and administrative-based microdata and documentation

### What it does

The Microdata Library allows researchers to browse, search, compare, apply for access and download relevant survey and census information from the Pacific Islands region. It allows data producers to disseminate survey information in a secured environment, in compliance with policies and conditions of use.

Note: security and access of microdata is closely controlled and can be accessed only under strict rules and conditions.Users of microdata need to be bona-fide researchers linked to clearly defined public-good (i.e. non-commercial) research projects.However all associated documentation is openly accessible to all users.

### Search

Users can search inside datasets, down to the names of indicators and variables. This is a valuable feature of the library because it allows the possibility to explore a dataset’s variables (if documented) in detail and show response frequencies. This kind of “deep search” allows users to discover data they may not even know existed.

### Metadata

The only thing more important than data is Metadata. Who made this dataset? How was it produced or acquired? When was it last updated? Who’s allowed to use it? What have people already done with it? Are algorithms shared that will allow for reproducing the construction of a dataset or indicator? While the catalog tags each dataset with some basic metadata consistent across all datasets, the amount and nature of the metadata will vary depending on the type of dataset

### Tracking data use - citations & visualizations

The Microdata Library also features a list of citations including those from articles and books which referring to a study (dataset). Data producers often don’t get enough credit for their data work - part of the reason is that it’s hard to track where data have been cited, used and re-used. Understanding where and how the data are used helps us understand the impact of the dataset and divert investments in priority data areas in the Pacific. It incentivises data providers to release their data more proactively much like research papers, giving them more accountability.


# User Guide

Entry point for documented census and survey datasets, and access to microdata

For an introduction on how to use the Microdata Library see this video :

{% embed url="<https://youtu.be/p-ZAqoVyrKE>" %}

## Access the Microdata Library

### Directly via Microdata Library URL

The Microdata Library is accessible using the following URL:

<https://microdata.pacificdata.org/>

### From the Data Catalogue

The application is also accessible in several ways from the [Data Catalogue](https://pacificdata.org/):

A link is available from the "Tools" menu:

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MK8FB6rGLByTXw1NCI-%2F-MK8FSMyBSXjJ4F4Yq-e%2FMicrodata%20Library%20PDH%20menu.png?alt=media\&token=03adff3d-2f8a-42de-bc86-7a7243bba4f8)

PDH Data Catalogue entries have a link to visualize the data at its source (Microdata Library):

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MK8FB6rGLByTXw1NCI-%2F-MK8FWjPwhBNoctdNdII%2FLink%20to%20microdata%20library%20from%20PDH.png?alt=media\&token=c7684968-1dfa-4726-975a-60f8095a01cc)

## Find studies using the Microdata Library Central Catalog

The Microdata Library Central Data Catalog allows users to search for published studies (censuses and surveys).

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MK8FB6rGLByTXw1NCI-%2F-MK8Hb7Pc_svQCZPE6Zx%2FMicrodata%20Library%20Central%20Data%20Catalog.png?alt=media\&token=ee146d05-8f18-4a32-825d-bea4dcb831cb)

&#x20;A keyword search returns datasets containing the given keyword(s) in titles and descriptions. The variable description can also be used to search in more detail.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MK8FB6rGLByTXw1NCI-%2F-MK8ITlOKAPxq9hJfcG_%2FMicrodata%20Library%20Central%20Data%20Catalog2.png?alt=media\&token=ce689e28-cfcc-438b-900b-f7107c31035e)

### From the Pacific Data Hub Data Calalogue

The Microdata Library is registered in the Data Catalogue and can also be found using its various different functionnalities. For more information see [dedicated section on the use of the Data Catalogue](https://app.gitbook.com/@pacific-community-spc/s/pacific-data-hub/~/drafts/-MJz0A5FvX84FSq5yBMJ/catalogue).

## Explore a study

**Study Description** - details all components of a study (census or survey) from identification to metadata production.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHGPzUys3IBvnU4tRg%2F-MKHJBHGwwuJIlNkO0BK%2FMicrodata%20Library%20explore%20study.png?alt=media\&token=ae46a131-2a78-4a5c-824e-b7485f72b884)

**Documentation** - provides access to questionnaires, reports, technical documents etc.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHGPzUys3IBvnU4tRg%2F-MKHJFFcVKUnHVwCdayv%2FMicrodata%20Library%20explore%20study%20-%20documentation.png?alt=media\&token=522aa87c-0ff9-4f74-9630-680f3e0ce6e5)

**Data Description** - provides a full listing of all datasets and variables created as part of the study.

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHGPzUys3IBvnU4tRg%2F-MKHJIbAo8DLvryaPobH%2FMicrodata%20Library%20explore%20study%20-%20data%20description.png?alt=media\&token=16a7a080-171a-4d59-8d2a-8b12710cc394)

Clicking on a data file provides a listing of all variables. Clicking on a variable then displays a profile of that variables' responses.&#x20;

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHGPzUys3IBvnU4tRg%2F-MKHKZYTMkQXkpVBAbQT%2FMicrodata%20Library%20explore%20study%20-%20data%20description%20-%20variable.png?alt=media\&token=6adb4961-00ac-4745-bfa7-eba94ff18fad)

## Access microdata

To access microdata (where available), create an account and then follow the data request instructions

![](https://3496061366-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDSpD50SdXxsYnU7P9D%2F-MKHGPzUys3IBvnU4tRg%2F-MKHJOo7QxpcS0vlP9Jr%2FMicrodata%20Library%20explore%20study%20-%20get%20microdata.png?alt=media\&token=5b49c746-4fdd-4e4e-91bf-30b798f96884)


