px-web api use in instat

13
Px-Web API use in INSTAT

Upload: hope-walker

Post on 02-Jan-2016

53 views

Category:

Documents


0 download

DESCRIPTION

Px-Web API use in INSTAT. Table of Contents. About PX-Web API PX-Web API use in INSTAT About Data Visualization Project Future plans. About PX-Web API. PxWeb API A programmatic way to access px-web database - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Px-Web API use in INSTAT

Px-Web API use in INSTAT

Page 2: Px-Web API use in INSTAT

Table of Contents

About PX-Web API PX-Web API use in INSTAT About Data Visualization Project Future plans

Page 3: Px-Web API use in INSTAT

About PX-Web API

PxWeb API A programmatic way to access px-web

database GET Request: metadata about databases, levels,

tables, contents and variables of a table Returns a json format of the metadata

POST Request: post a query for retrieving data from a table

Returns a specified format of the filtered table (json, xml, px, csv.)

Page 4: Px-Web API use in INSTAT

About PX-Web API

GET Request: API/LANGUAGE/DATABASE-ID/<LEVELS>/TABLE-ID http://instat.gov.al:8080/api/al/DST/LSMS/LSMS

01 JSON metadata response

POST Request: Posting a json formatted request to the above url will return a response with the data filtered according to the posted query. User specified format response

Page 5: Px-Web API use in INSTAT

PX-Web API GET request

Example resoponse of the GET request “/api/en” [{"dbid":"DST","text":"Statistical database"}]

Example response of the GET request “/api/en/DST/ND”

[{"id":"ND0001","type":"t","text":"Constructions by their type- Riconstructions 2004-1 - 2012-4"},

{"id":"ND0002","type":"t","text":"Dwelling by prefecture by prefectures according to construction permits 2005 - 2011"},

{"id":"ND0003","type":"t","text":"Number and square meter of building permits issue for new buildings 2004-1 - 2012-4"},

{"id":"ND0004","type":"t","text":"Dwelling by district according to construction permits 2005 - 2011"},

{"id":"ND0005","type":"t","text":"Value of building permits issued by clients for buildings and civil engineering works 1999 - 2011"},

{"id":"ND0006","type":"t","text":"Approximate value- New constructions 2004-1 - 2012-4"}]

Page 6: Px-Web API use in INSTAT

04/20/23

PxWeb API POST request

Example of POST request into the url "http://instat.gov.al:8080/api/en/DST/OS/DVS/DVS0008/" {"query": [{"code": "NivArsim", "selection": {"filter": "all","values":

["*"]}},{"code": "urban_rural", "selection": {"filter": "all","values": ["*"]}},{"code": "Vit", "selection": {"filter": "all", "values": ["*"] }}],"response": { "format": "json" }}:

response {"columns":[{"code":"NivArsim","text":"Level of Education

","type":"d"},{"code":"urban_rural","text":"urban_rural","type":"d"},{"code":"Vit","text":"Year","type":"t"},{"code":"Instat1","text":"Women Percentage","type":"c"}],"comments":[],"data":[{"key":["1","1","2013"],"values":["3.0"]},{"key":["1","2","2013"],"values":["5.9"]},{"key":["2","1","2013"],"values":["26.9"]},{"key":["2","2","2013"],"values":["55.0"]},{"key":["3","1","2013"],"values":["46.9"]},{"key":["3","2","2013"],"values":["33.9"]},{"key":["4","1","2013"],"values":["23.2"]},{"key":["4","2","2013"],"values":["5.2"]}]}

Page 7: Px-Web API use in INSTAT

04/20/23

PX-Web API use in INSTAT

Programmatic access to our pxweb database Internal use for our Data Visualization

Project Charts and table data are provided from px web

database using pxweb api queries Users can programmatically access our

database for automatic update of figures in their reports

Page 8: Px-Web API use in INSTAT

PX-Web API use in INSTAT

Visualization of INSTAT publications

Page 9: Px-Web API use in INSTAT

About Data Visualization Project

Visual Studio 2013 SQL Server 2012 ASP.net .Net Framework 4.5 Entity Framework (Database First Model) LINQ JQuery JQPlot Pivot js

Page 10: Px-Web API use in INSTAT

About Data Visualization Project

Visualization of INSTAT publications (Tables)

Pivot.js

Page 11: Px-Web API use in INSTAT

About Data Visualization Project

Visualization of INSTAT publications (Charts)

Jqplot

Page 12: Px-Web API use in INSTAT

Future plans

Visualize main INSTAT publication Create a loading application to populate

the database Extend the use of the API for other

purposes External users as well

Page 13: Px-Web API use in INSTAT

Thank You For Your Attention!