Difference between revisions of "Pull data from third party REST API"

From Fusion Registry Wiki
Jump to navigation Jump to search
(Created page with "Category:How_To ==Overview== If an organisation is hosting a SDMX REST API, then it is possible to pull structural metadata and data from this service into your local Fusi...")
 
Line 3: Line 3:
 
If an organisation is hosting a SDMX REST API, then it is possible to pull structural metadata and data from this service into your local Fusion Registry instance via a number of web service calls.  There are two ways this can be achieved. The simplest way is to use the Fusion Registry data portal feature (in Beta).  Another approach is to use the Fusion Registry load structures/data pages and insert the appropriate REST URL.  The benefit of the data portal is that the Fusion Registry does all of the work for you, it handles errors and merging of structures, it will even split the data query into multiple parts if the end service does not support large queries.  This how to guide discusses both approaches.
 
If an organisation is hosting a SDMX REST API, then it is possible to pull structural metadata and data from this service into your local Fusion Registry instance via a number of web service calls.  There are two ways this can be achieved. The simplest way is to use the Fusion Registry data portal feature (in Beta).  Another approach is to use the Fusion Registry load structures/data pages and insert the appropriate REST URL.  The benefit of the data portal is that the Fusion Registry does all of the work for you, it handles errors and merging of structures, it will even split the data query into multiple parts if the end service does not support large queries.  This how to guide discusses both approaches.
  
 +
== Example REST API ==
 
For the purpose of this 'how to' the web service of the European Central Bank will be used, the API can be found by Googling 'ECB SDMX REST API' which at the time of writing links to this [https://ec.europa.eu/eurostat/web/sdmx-web-services/rest-sdmx-2.1 page]:
 
For the purpose of this 'how to' the web service of the European Central Bank will be used, the API can be found by Googling 'ECB SDMX REST API' which at the time of writing links to this [https://ec.europa.eu/eurostat/web/sdmx-web-services/rest-sdmx-2.1 page]:
  
Line 17: Line 18:
 
  [http://ec.europa.eu/eurostat/SDMX/diss-web/rest/codelist http://ec.europa.eu/eurostat/SDMX/diss-web/rest/'''codelist'''] = query for all codelists
 
  [http://ec.europa.eu/eurostat/SDMX/diss-web/rest/codelist http://ec.europa.eu/eurostat/SDMX/diss-web/rest/'''codelist'''] = query for all codelists
  
== Use Case
+
== Pull Data using Data Portal Feature ==
 +
The Fusion Registry has a Beta feature called the Data Portal.  To access this feature, log in as an Admin user and navigate to the Fusion Data Portal which is available at the following URL:
 +
 
 +
https://your.server/FusionRegistry/admin/portal.html
 +
 
 +
Click the 'Add Service' button and complete the form
 +
 
 +
[[File:Fusion portal.png|thumb|External service form]]

Revision as of 12:10, 23 November 2020

Overview

If an organisation is hosting a SDMX REST API, then it is possible to pull structural metadata and data from this service into your local Fusion Registry instance via a number of web service calls. There are two ways this can be achieved. The simplest way is to use the Fusion Registry data portal feature (in Beta). Another approach is to use the Fusion Registry load structures/data pages and insert the appropriate REST URL. The benefit of the data portal is that the Fusion Registry does all of the work for you, it handles errors and merging of structures, it will even split the data query into multiple parts if the end service does not support large queries. This how to guide discusses both approaches.

Example REST API

For the purpose of this 'how to' the web service of the European Central Bank will be used, the API can be found by Googling 'ECB SDMX REST API' which at the time of writing links to this page:

The important thing to look for in a REST API is the entry point. The URL is the constructed by taking a base URL and postfixing the query parameters to the end, for data queries this starts with the word 'data' and for structure queries it starts with the structure type being queried, for example 'codelist'. On the ECB REST API page, example queries are provided which look like this:

http://ec.europa.eu/eurostat/SDMX/diss-web/rest/data/nama_10_gdp/.CLV10_MEUR.B1GQ.BE/?startperiod=2005&endPeriod=2011

The important part of the above URL is everything before the path /data/, this is the entry point to their web service, which is as follows:

http://ec.europa.eu/eurostat/SDMX/diss-web/rest/

We can use this URL to construct queries for both data and structures, for example

http://ec.europa.eu/eurostat/SDMX/diss-web/rest/codelist = query for all codelists

Pull Data using Data Portal Feature

The Fusion Registry has a Beta feature called the Data Portal. To access this feature, log in as an Admin user and navigate to the Fusion Data Portal which is available at the following URL:

https://your.server/FusionRegistry/admin/portal.html

Click the 'Add Service' button and complete the form

External service form