SlideShare a Scribd company logo
Introduction to Application
Programming Interfaces,
and ONS’ APIs
Andrew Fergusson
Lead Data Scientist
ONS ⊃ Digital Publishing ⊃ Data Service
andrew.fergusson@ons.gov.uk
Teams, 6 July 2023
Agenda
• What are APIs?
• Advantages of APIs
• Practical demonstration of APIs
What is an API?
More importantly why should you care?
Analysis lifecycle
Wrangle
Data
Analysis Disseminate
Data wrangling sucks
• Spreadsheets are presentational, not designed for
analysis
• Cross tabs typically only have two dimensions
• Got to re-interpret the column headers, unpivot the data
• Contains more data than you need
• Not value add!
Application Programming Interfaces
• A set of rules and protocols that allows software and data
sources to communicate
• Standards-backed, e.g. HTTP Methods (information
transfer), HTTP Status Codes (like 200 Okay 401
Unauthorized), JSON, XML
• Can be accessed using URLs which contain your
request details (a HTTP GET) or with a JSON file a
(HTTP PUT)
Some useful APIs (Not just for reading data!)
• The ONS Census and CMD API:
https://developer.ons.gov.uk/
• The NHS Fingertips API: https://fingertips.phe.org.uk/api
• HMRC’s suite of APIs:
https://developer.service.hmrc.gov.uk/api-
documentation/docs/api
• DWP’s suite of APIs:
https://www.api.gov.uk/dwp/#department-for-work-and-
pensions
APIs are a set of
procedures to access
data
There may be lots of new terms here, but consuming APIs is risk-
free. The worst outcome of a bad API call you’ll experience from
an ONS API is that it didn’t understand your query.
Photo by Kevin Fitzgerald on Unsplash
Advantages of APIs
Why should you use APIs?
Why you should use APIs
• Formatted for analysis
• Filtered for your patch
• No transformation errors
• Automated updates
• Real-time data (depends!)
• Enriched data sources
• Increased efficiency
• Enhanced quality
• Collaboration and sharing
• Agility and adaptability
Using or not using an
API is your choice
Configuring a service to use an API may take a bit more
effort but you’ll get all of that time back and then some.
Photo by Bernd 📷 Dittrich on Unsplash
Practical demonstration
of APIs
Introduction to the ONS Census API
Notes about this demonstration
• This demonstration is using Visual Studio Code, a free Integrated
Developer Environment, and Python a programming language
• The examples are configurable, and the presentational document will be
available after this session
• This example is more advanced than the autumn sessions, but it is
necessary to demonstrate how the ONS Census API works
• PowerBI and Tableau can consume APIs directly, and interpret the API’s responses in
JSON for you
• Programming in Python will not be required
• Being familiar with how the API structures data helps you think about your requests

More Related Content

What's hot

Supporting local policy making
Supporting local policy makingSupporting local policy making
Supporting local policy making
Office for National Statistics
 
ONS Economic Forum - 26 September 2022
ONS Economic Forum - 26 September 2022ONS Economic Forum - 26 September 2022
ONS Economic Forum - 26 September 2022
Office for National Statistics
 
Data Visualization1.pptx
Data Visualization1.pptxData Visualization1.pptx
Data Visualization1.pptx
qwtadhsaber
 
ONS business data and statistics user event
ONS business data and statistics user eventONS business data and statistics user event
ONS business data and statistics user event
Office for National Statistics
 
Economic Data Science
Economic Data Science Economic Data Science
Economic Data Science
Office for National Statistics
 
ONS Local presents: Census 2021, products and analysis
ONS Local presents: Census 2021, products and analysisONS Local presents: Census 2021, products and analysis
ONS Local presents: Census 2021, products and analysis
Office for National Statistics
 
How to Monetize Your Data Assets and Gain a Competitive Advantage
How to Monetize Your Data Assets and Gain a Competitive AdvantageHow to Monetize Your Data Assets and Gain a Competitive Advantage
How to Monetize Your Data Assets and Gain a Competitive Advantage
CCG
 
ONS local presents clustering
ONS local presents clusteringONS local presents clustering
ONS local presents clustering
Office for National Statistics
 
ONS Economic Forum - 14 November 2022
ONS Economic Forum - 14 November 2022ONS Economic Forum - 14 November 2022
ONS Economic Forum - 14 November 2022
Office for National Statistics
 
ONS Local presents Suffolk County Council's Cost of Living Dashboard
ONS Local presents Suffolk County Council's Cost of Living DashboardONS Local presents Suffolk County Council's Cost of Living Dashboard
ONS Local presents Suffolk County Council's Cost of Living Dashboard
Office for National Statistics
 
Data analysis
Data analysisData analysis
Data analysis
kunaljoshi79
 
pbs.pptx
pbs.pptxpbs.pptx
pbs.pptx
HumaNaz46
 
Transforming the ONS’s household financial statistics
Transforming the ONS’s household financial statisticsTransforming the ONS’s household financial statistics
Transforming the ONS’s household financial statistics
Office for National Statistics
 
Introduction to Python for Data Science
Introduction to Python for Data ScienceIntroduction to Python for Data Science
Introduction to Python for Data Science
Arc & Codementor
 
ONS Economic Forum - 10 October 2022
ONS Economic Forum -  10 October 2022ONS Economic Forum -  10 October 2022
ONS Economic Forum - 10 October 2022
Office for National Statistics
 
SlideShare ONS Economic Forum Slidepack - 12 June 2023
SlideShare ONS Economic Forum Slidepack - 12 June 2023SlideShare ONS Economic Forum Slidepack - 12 June 2023
SlideShare ONS Economic Forum Slidepack - 12 June 2023
Office for National Statistics
 
India's sex ratio
India's sex ratioIndia's sex ratio
India's sex ratio
Diane D'Souza
 
Principles of Data Visualization
Principles of Data VisualizationPrinciples of Data Visualization
Principles of Data Visualization
Eamonn Maguire
 
Demography, data and development
Demography, data and development Demography, data and development
Demography, data and development
Tom LeGrand
 
ONS Local presents: Using Open Data to visualise public transport coverage
ONS Local presents: Using Open Data to visualise public transport coverageONS Local presents: Using Open Data to visualise public transport coverage
ONS Local presents: Using Open Data to visualise public transport coverage
Office for National Statistics
 

What's hot (20)

Supporting local policy making
Supporting local policy makingSupporting local policy making
Supporting local policy making
 
ONS Economic Forum - 26 September 2022
ONS Economic Forum - 26 September 2022ONS Economic Forum - 26 September 2022
ONS Economic Forum - 26 September 2022
 
Data Visualization1.pptx
Data Visualization1.pptxData Visualization1.pptx
Data Visualization1.pptx
 
ONS business data and statistics user event
ONS business data and statistics user eventONS business data and statistics user event
ONS business data and statistics user event
 
Economic Data Science
Economic Data Science Economic Data Science
Economic Data Science
 
ONS Local presents: Census 2021, products and analysis
ONS Local presents: Census 2021, products and analysisONS Local presents: Census 2021, products and analysis
ONS Local presents: Census 2021, products and analysis
 
How to Monetize Your Data Assets and Gain a Competitive Advantage
How to Monetize Your Data Assets and Gain a Competitive AdvantageHow to Monetize Your Data Assets and Gain a Competitive Advantage
How to Monetize Your Data Assets and Gain a Competitive Advantage
 
ONS local presents clustering
ONS local presents clusteringONS local presents clustering
ONS local presents clustering
 
ONS Economic Forum - 14 November 2022
ONS Economic Forum - 14 November 2022ONS Economic Forum - 14 November 2022
ONS Economic Forum - 14 November 2022
 
ONS Local presents Suffolk County Council's Cost of Living Dashboard
ONS Local presents Suffolk County Council's Cost of Living DashboardONS Local presents Suffolk County Council's Cost of Living Dashboard
ONS Local presents Suffolk County Council's Cost of Living Dashboard
 
Data analysis
Data analysisData analysis
Data analysis
 
pbs.pptx
pbs.pptxpbs.pptx
pbs.pptx
 
Transforming the ONS’s household financial statistics
Transforming the ONS’s household financial statisticsTransforming the ONS’s household financial statistics
Transforming the ONS’s household financial statistics
 
Introduction to Python for Data Science
Introduction to Python for Data ScienceIntroduction to Python for Data Science
Introduction to Python for Data Science
 
ONS Economic Forum - 10 October 2022
ONS Economic Forum -  10 October 2022ONS Economic Forum -  10 October 2022
ONS Economic Forum - 10 October 2022
 
SlideShare ONS Economic Forum Slidepack - 12 June 2023
SlideShare ONS Economic Forum Slidepack - 12 June 2023SlideShare ONS Economic Forum Slidepack - 12 June 2023
SlideShare ONS Economic Forum Slidepack - 12 June 2023
 
India's sex ratio
India's sex ratioIndia's sex ratio
India's sex ratio
 
Principles of Data Visualization
Principles of Data VisualizationPrinciples of Data Visualization
Principles of Data Visualization
 
Demography, data and development
Demography, data and development Demography, data and development
Demography, data and development
 
ONS Local presents: Using Open Data to visualise public transport coverage
ONS Local presents: Using Open Data to visualise public transport coverageONS Local presents: Using Open Data to visualise public transport coverage
ONS Local presents: Using Open Data to visualise public transport coverage
 

Similar to ONS Local and Data Science Community Workshop 1: How to use APIs

apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays
 
Oscon2014 Netflix API - Top 10 Lessons Learned
Oscon2014 Netflix API - Top 10 Lessons LearnedOscon2014 Netflix API - Top 10 Lessons Learned
Oscon2014 Netflix API - Top 10 Lessons Learned
Sangeeta Narayanan
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptx
apidays
 
Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014Daniel Jacobson
 
API ARU-ARU
API ARU-ARUAPI ARU-ARU
The Ultimate API Publisher's Guide
The Ultimate API Publisher's GuideThe Ultimate API Publisher's Guide
The Ultimate API Publisher's Guide
Pronovix
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies
BIOVIA
 
Flavours of APIs
Flavours of APIs Flavours of APIs
Flavours of APIs
Chris Phillips
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
RahulCR31
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
RahulCR31
 
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays
 
Application Insights for Integration Developers
Application Insights for Integration DevelopersApplication Insights for Integration Developers
Application Insights for Integration Developers
Sriram Hariharan
 
Designing Usable APIs featuring Forrester Research, Inc.
Designing Usable APIs featuring Forrester Research, Inc.Designing Usable APIs featuring Forrester Research, Inc.
Designing Usable APIs featuring Forrester Research, Inc.
CA API Management
 
Service api design validation & collaboration
Service api design validation & collaborationService api design validation & collaboration
Service api design validation & collaboration
Uchit Vyas ☁
 
apidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMG
apidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMGapidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMG
apidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMG
apidays
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for Longevity
MuleSoft
 
APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...
APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...
APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...
apidays
 
Making the Most of Power BI with SQL Server 2014 and Azure
Making the Most of Power BI with SQL Server 2014 and AzureMaking the Most of Power BI with SQL Server 2014 and Azure
Making the Most of Power BI with SQL Server 2014 and Azure
Perficient, Inc.
 
SPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenarios
SPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenariosSPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenarios
SPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenarios
Ahmad Najjar
 
Api design part 1
Api design part 1Api design part 1
Api design part 1
Ibrahim Elsawaf
 

Similar to ONS Local and Data Science Community Workshop 1: How to use APIs (20)

apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
 
Oscon2014 Netflix API - Top 10 Lessons Learned
Oscon2014 Netflix API - Top 10 Lessons LearnedOscon2014 Netflix API - Top 10 Lessons Learned
Oscon2014 Netflix API - Top 10 Lessons Learned
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptx
 
Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014
 
API ARU-ARU
API ARU-ARUAPI ARU-ARU
API ARU-ARU
 
The Ultimate API Publisher's Guide
The Ultimate API Publisher's GuideThe Ultimate API Publisher's Guide
The Ultimate API Publisher's Guide
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies
 
Flavours of APIs
Flavours of APIs Flavours of APIs
Flavours of APIs
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
 
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
 
Application Insights for Integration Developers
Application Insights for Integration DevelopersApplication Insights for Integration Developers
Application Insights for Integration Developers
 
Designing Usable APIs featuring Forrester Research, Inc.
Designing Usable APIs featuring Forrester Research, Inc.Designing Usable APIs featuring Forrester Research, Inc.
Designing Usable APIs featuring Forrester Research, Inc.
 
Service api design validation & collaboration
Service api design validation & collaborationService api design validation & collaboration
Service api design validation & collaboration
 
apidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMG
apidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMGapidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMG
apidays LIVE New York 2021 - Service API design validation by Uchit Vyas, KPMG
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for Longevity
 
APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...
APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...
APIdays Helsinki 2019 - How API Will Help Win the Deals - the Case of Infrast...
 
Making the Most of Power BI with SQL Server 2014 and Azure
Making the Most of Power BI with SQL Server 2014 and AzureMaking the Most of Power BI with SQL Server 2014 and Azure
Making the Most of Power BI with SQL Server 2014 and Azure
 
SPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenarios
SPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenariosSPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenarios
SPS Dubai 2017 - PowerApps & Microsoft Flow: Advanced scenarios
 
Api design part 1
Api design part 1Api design part 1
Api design part 1
 

More from Office for National Statistics

Slideshare - ONS Economic Forum Slidepack - 13 May 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 13 May 2024.pptxSlideshare - ONS Economic Forum Slidepack - 13 May 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 13 May 2024.pptx
Office for National Statistics
 
SlideShare ONS Economic Forum Slidepack - 22 April 2024.
SlideShare ONS Economic Forum Slidepack - 22 April 2024.SlideShare ONS Economic Forum Slidepack - 22 April 2024.
SlideShare ONS Economic Forum Slidepack - 22 April 2024.
Office for National Statistics
 
Slideshare - ONS Economic Forum Slidepack - 18 March 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 18 March 2024.pptxSlideshare - ONS Economic Forum Slidepack - 18 March 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 18 March 2024.pptx
Office for National Statistics
 
Slideshare - ONS Economic Forum Slidepack - 19 February 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 19 February 2024.pptxSlideshare - ONS Economic Forum Slidepack - 19 February 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 19 February 2024.pptx
Office for National Statistics
 
SlideShare ONS Economic Forum Slidepack - 22 January 2024
SlideShare ONS Economic Forum Slidepack - 22 January 2024SlideShare ONS Economic Forum Slidepack - 22 January 2024
SlideShare ONS Economic Forum Slidepack - 22 January 2024
Office for National Statistics
 
Beyond GDP: international developments and emerging frameworks - 26 September...
Beyond GDP: international developments and emerging frameworks - 26 September...Beyond GDP: international developments and emerging frameworks - 26 September...
Beyond GDP: international developments and emerging frameworks - 26 September...
Office for National Statistics
 
SlideShare ONS Economic Forum Slidepack - 11 December 2023
SlideShare ONS Economic Forum Slidepack - 11 December 2023SlideShare ONS Economic Forum Slidepack - 11 December 2023
SlideShare ONS Economic Forum Slidepack - 11 December 2023
Office for National Statistics
 
SlideShare ONS Economic Forum Slidepack - 13 November 2023
SlideShare ONS Economic Forum Slidepack - 13 November 2023SlideShare ONS Economic Forum Slidepack - 13 November 2023
SlideShare ONS Economic Forum Slidepack - 13 November 2023
Office for National Statistics
 
SlideShare ONS Economic Forum Slidepack - 16 October 2023
SlideShare ONS Economic Forum Slidepack - 16 October 2023SlideShare ONS Economic Forum Slidepack - 16 October 2023
SlideShare ONS Economic Forum Slidepack - 16 October 2023
Office for National Statistics
 
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
Office for National Statistics
 
GDP after 2025: updating national accounts and balance of payments – 11 Octob...
GDP after 2025: updating national accounts and balance of payments – 11 Octob...GDP after 2025: updating national accounts and balance of payments – 11 Octob...
GDP after 2025: updating national accounts and balance of payments – 11 Octob...
Office for National Statistics
 
SlideShare Measuring the Economy Slidepack - 29 September 2023
SlideShare Measuring the Economy Slidepack - 29 September 2023SlideShare Measuring the Economy Slidepack - 29 September 2023
SlideShare Measuring the Economy Slidepack - 29 September 2023
Office for National Statistics
 
Why dashboards?
Why dashboards?Why dashboards?
SlideShare ONS Economic Forum Slidepack - 18 September 2023
SlideShare ONS Economic Forum Slidepack - 18 September 2023SlideShare ONS Economic Forum Slidepack - 18 September 2023
SlideShare ONS Economic Forum Slidepack - 18 September 2023
Office for National Statistics
 
Connecting to the StatXplore API in PowerBI
Connecting to the StatXplore API in PowerBIConnecting to the StatXplore API in PowerBI
Connecting to the StatXplore API in PowerBI
Office for National Statistics
 
ONS Local presents: Adult Education Outcomes in London
ONS Local presents: Adult Education Outcomes in LondonONS Local presents: Adult Education Outcomes in London
ONS Local presents: Adult Education Outcomes in London
Office for National Statistics
 
ONS Local presents - Census 2021 Education Analysis
ONS Local presents - Census 2021 Education AnalysisONS Local presents - Census 2021 Education Analysis
ONS Local presents - Census 2021 Education Analysis
Office for National Statistics
 
SlideShare Annual crime and justice statistics forum 2023.pptx
SlideShare Annual crime and justice statistics forum 2023.pptxSlideShare Annual crime and justice statistics forum 2023.pptx
SlideShare Annual crime and justice statistics forum 2023.pptx
Office for National Statistics
 
ONS Local presents: GLA's High Streets Data Service Tool
ONS Local presents: GLA's High Streets Data Service ToolONS Local presents: GLA's High Streets Data Service Tool
ONS Local presents: GLA's High Streets Data Service Tool
Office for National Statistics
 

More from Office for National Statistics (19)

Slideshare - ONS Economic Forum Slidepack - 13 May 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 13 May 2024.pptxSlideshare - ONS Economic Forum Slidepack - 13 May 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 13 May 2024.pptx
 
SlideShare ONS Economic Forum Slidepack - 22 April 2024.
SlideShare ONS Economic Forum Slidepack - 22 April 2024.SlideShare ONS Economic Forum Slidepack - 22 April 2024.
SlideShare ONS Economic Forum Slidepack - 22 April 2024.
 
Slideshare - ONS Economic Forum Slidepack - 18 March 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 18 March 2024.pptxSlideshare - ONS Economic Forum Slidepack - 18 March 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 18 March 2024.pptx
 
Slideshare - ONS Economic Forum Slidepack - 19 February 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 19 February 2024.pptxSlideshare - ONS Economic Forum Slidepack - 19 February 2024.pptx
Slideshare - ONS Economic Forum Slidepack - 19 February 2024.pptx
 
SlideShare ONS Economic Forum Slidepack - 22 January 2024
SlideShare ONS Economic Forum Slidepack - 22 January 2024SlideShare ONS Economic Forum Slidepack - 22 January 2024
SlideShare ONS Economic Forum Slidepack - 22 January 2024
 
Beyond GDP: international developments and emerging frameworks - 26 September...
Beyond GDP: international developments and emerging frameworks - 26 September...Beyond GDP: international developments and emerging frameworks - 26 September...
Beyond GDP: international developments and emerging frameworks - 26 September...
 
SlideShare ONS Economic Forum Slidepack - 11 December 2023
SlideShare ONS Economic Forum Slidepack - 11 December 2023SlideShare ONS Economic Forum Slidepack - 11 December 2023
SlideShare ONS Economic Forum Slidepack - 11 December 2023
 
SlideShare ONS Economic Forum Slidepack - 13 November 2023
SlideShare ONS Economic Forum Slidepack - 13 November 2023SlideShare ONS Economic Forum Slidepack - 13 November 2023
SlideShare ONS Economic Forum Slidepack - 13 November 2023
 
SlideShare ONS Economic Forum Slidepack - 16 October 2023
SlideShare ONS Economic Forum Slidepack - 16 October 2023SlideShare ONS Economic Forum Slidepack - 16 October 2023
SlideShare ONS Economic Forum Slidepack - 16 October 2023
 
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
 
GDP after 2025: updating national accounts and balance of payments – 11 Octob...
GDP after 2025: updating national accounts and balance of payments – 11 Octob...GDP after 2025: updating national accounts and balance of payments – 11 Octob...
GDP after 2025: updating national accounts and balance of payments – 11 Octob...
 
SlideShare Measuring the Economy Slidepack - 29 September 2023
SlideShare Measuring the Economy Slidepack - 29 September 2023SlideShare Measuring the Economy Slidepack - 29 September 2023
SlideShare Measuring the Economy Slidepack - 29 September 2023
 
Why dashboards?
Why dashboards?Why dashboards?
Why dashboards?
 
SlideShare ONS Economic Forum Slidepack - 18 September 2023
SlideShare ONS Economic Forum Slidepack - 18 September 2023SlideShare ONS Economic Forum Slidepack - 18 September 2023
SlideShare ONS Economic Forum Slidepack - 18 September 2023
 
Connecting to the StatXplore API in PowerBI
Connecting to the StatXplore API in PowerBIConnecting to the StatXplore API in PowerBI
Connecting to the StatXplore API in PowerBI
 
ONS Local presents: Adult Education Outcomes in London
ONS Local presents: Adult Education Outcomes in LondonONS Local presents: Adult Education Outcomes in London
ONS Local presents: Adult Education Outcomes in London
 
ONS Local presents - Census 2021 Education Analysis
ONS Local presents - Census 2021 Education AnalysisONS Local presents - Census 2021 Education Analysis
ONS Local presents - Census 2021 Education Analysis
 
SlideShare Annual crime and justice statistics forum 2023.pptx
SlideShare Annual crime and justice statistics forum 2023.pptxSlideShare Annual crime and justice statistics forum 2023.pptx
SlideShare Annual crime and justice statistics forum 2023.pptx
 
ONS Local presents: GLA's High Streets Data Service Tool
ONS Local presents: GLA's High Streets Data Service ToolONS Local presents: GLA's High Streets Data Service Tool
ONS Local presents: GLA's High Streets Data Service Tool
 

Recently uploaded

Uniform Guidance 3.0 - The New 2 CFR 200
Uniform Guidance 3.0 - The New 2 CFR 200Uniform Guidance 3.0 - The New 2 CFR 200
Uniform Guidance 3.0 - The New 2 CFR 200
GrantManagementInsti
 
如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样
如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样
如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样
850fcj96
 
一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单
一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单
一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单
ehbuaw
 
MHM Roundtable Slide Deck WHA Side-event May 28 2024.pptx
MHM Roundtable Slide Deck WHA Side-event May 28 2024.pptxMHM Roundtable Slide Deck WHA Side-event May 28 2024.pptx
MHM Roundtable Slide Deck WHA Side-event May 28 2024.pptx
ILC- UK
 
PD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptx
PD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptxPD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptx
PD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptx
RIDPRO11
 
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单
ukyewh
 
Understanding the Challenges of Street Children
Understanding the Challenges of Street ChildrenUnderstanding the Challenges of Street Children
Understanding the Challenges of Street Children
SERUDS INDIA
 
The Role of a Process Server in real estate
The Role of a Process Server in real estateThe Role of a Process Server in real estate
The Role of a Process Server in real estate
oklahomajudicialproc1
 
Canadian Immigration Tracker March 2024 - Key Slides
Canadian Immigration Tracker March 2024 - Key SlidesCanadian Immigration Tracker March 2024 - Key Slides
Canadian Immigration Tracker March 2024 - Key Slides
Andrew Griffith
 
Up the Ratios Bylaws - a Comprehensive Process of Our Organization
Up the Ratios Bylaws - a Comprehensive Process of Our OrganizationUp the Ratios Bylaws - a Comprehensive Process of Our Organization
Up the Ratios Bylaws - a Comprehensive Process of Our Organization
uptheratios
 
一比一原版(WSU毕业证)西悉尼大学毕业证成绩单
一比一原版(WSU毕业证)西悉尼大学毕业证成绩单一比一原版(WSU毕业证)西悉尼大学毕业证成绩单
一比一原版(WSU毕业证)西悉尼大学毕业证成绩单
evkovas
 
快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样
快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样
快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样
850fcj96
 
ZGB - The Role of Generative AI in Government transformation.pdf
ZGB - The Role of Generative AI in Government transformation.pdfZGB - The Role of Generative AI in Government transformation.pdf
ZGB - The Role of Generative AI in Government transformation.pdf
Saeed Al Dhaheri
 
What is the point of small housing associations.pptx
What is the point of small housing associations.pptxWhat is the point of small housing associations.pptx
What is the point of small housing associations.pptx
Paul Smith
 
Many ways to support street children.pptx
Many ways to support street children.pptxMany ways to support street children.pptx
Many ways to support street children.pptx
SERUDS INDIA
 
一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单
一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单
一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单
ehbuaw
 
PPT Item # 9 - 2024 Street Maintenance Program(SMP) Amendment
PPT Item # 9 - 2024 Street Maintenance Program(SMP) AmendmentPPT Item # 9 - 2024 Street Maintenance Program(SMP) Amendment
PPT Item # 9 - 2024 Street Maintenance Program(SMP) Amendment
ahcitycouncil
 
PPT Item # 5 - 5330 Broadway ARB Case # 930F
PPT Item # 5 - 5330 Broadway ARB Case # 930FPPT Item # 5 - 5330 Broadway ARB Case # 930F
PPT Item # 5 - 5330 Broadway ARB Case # 930F
ahcitycouncil
 
PNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdf
PNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdfPNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdf
PNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdf
ClaudioTebaldi2
 
2024: The FAR - Federal Acquisition Regulations, Part 37
2024: The FAR - Federal Acquisition Regulations, Part 372024: The FAR - Federal Acquisition Regulations, Part 37
2024: The FAR - Federal Acquisition Regulations, Part 37
JSchaus & Associates
 

Recently uploaded (20)

Uniform Guidance 3.0 - The New 2 CFR 200
Uniform Guidance 3.0 - The New 2 CFR 200Uniform Guidance 3.0 - The New 2 CFR 200
Uniform Guidance 3.0 - The New 2 CFR 200
 
如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样
如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样
如何办理(uoit毕业证书)加拿大安大略理工大学毕业证文凭证书录取通知原版一模一样
 
一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单
一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单
一比一原版(ANU毕业证)澳大利亚国立大学毕业证成绩单
 
MHM Roundtable Slide Deck WHA Side-event May 28 2024.pptx
MHM Roundtable Slide Deck WHA Side-event May 28 2024.pptxMHM Roundtable Slide Deck WHA Side-event May 28 2024.pptx
MHM Roundtable Slide Deck WHA Side-event May 28 2024.pptx
 
PD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptx
PD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptxPD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptx
PD-1602-as-amended-by-RA-9287-Anti-Illegal-Gambling-Law.pptx
 
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单
 
Understanding the Challenges of Street Children
Understanding the Challenges of Street ChildrenUnderstanding the Challenges of Street Children
Understanding the Challenges of Street Children
 
The Role of a Process Server in real estate
The Role of a Process Server in real estateThe Role of a Process Server in real estate
The Role of a Process Server in real estate
 
Canadian Immigration Tracker March 2024 - Key Slides
Canadian Immigration Tracker March 2024 - Key SlidesCanadian Immigration Tracker March 2024 - Key Slides
Canadian Immigration Tracker March 2024 - Key Slides
 
Up the Ratios Bylaws - a Comprehensive Process of Our Organization
Up the Ratios Bylaws - a Comprehensive Process of Our OrganizationUp the Ratios Bylaws - a Comprehensive Process of Our Organization
Up the Ratios Bylaws - a Comprehensive Process of Our Organization
 
一比一原版(WSU毕业证)西悉尼大学毕业证成绩单
一比一原版(WSU毕业证)西悉尼大学毕业证成绩单一比一原版(WSU毕业证)西悉尼大学毕业证成绩单
一比一原版(WSU毕业证)西悉尼大学毕业证成绩单
 
快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样
快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样
快速制作(ocad毕业证书)加拿大安大略艺术设计学院毕业证本科学历雅思成绩单原版一模一样
 
ZGB - The Role of Generative AI in Government transformation.pdf
ZGB - The Role of Generative AI in Government transformation.pdfZGB - The Role of Generative AI in Government transformation.pdf
ZGB - The Role of Generative AI in Government transformation.pdf
 
What is the point of small housing associations.pptx
What is the point of small housing associations.pptxWhat is the point of small housing associations.pptx
What is the point of small housing associations.pptx
 
Many ways to support street children.pptx
Many ways to support street children.pptxMany ways to support street children.pptx
Many ways to support street children.pptx
 
一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单
一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单
一比一原版(UOW毕业证)伍伦贡大学毕业证成绩单
 
PPT Item # 9 - 2024 Street Maintenance Program(SMP) Amendment
PPT Item # 9 - 2024 Street Maintenance Program(SMP) AmendmentPPT Item # 9 - 2024 Street Maintenance Program(SMP) Amendment
PPT Item # 9 - 2024 Street Maintenance Program(SMP) Amendment
 
PPT Item # 5 - 5330 Broadway ARB Case # 930F
PPT Item # 5 - 5330 Broadway ARB Case # 930FPPT Item # 5 - 5330 Broadway ARB Case # 930F
PPT Item # 5 - 5330 Broadway ARB Case # 930F
 
PNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdf
PNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdfPNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdf
PNRR MADRID GREENTECH FOR BROWN NETWORKS NETWORKS MUR_MUSA_TEBALDI.pdf
 
2024: The FAR - Federal Acquisition Regulations, Part 37
2024: The FAR - Federal Acquisition Regulations, Part 372024: The FAR - Federal Acquisition Regulations, Part 37
2024: The FAR - Federal Acquisition Regulations, Part 37
 

ONS Local and Data Science Community Workshop 1: How to use APIs

  • 1. Introduction to Application Programming Interfaces, and ONS’ APIs Andrew Fergusson Lead Data Scientist ONS ⊃ Digital Publishing ⊃ Data Service andrew.fergusson@ons.gov.uk Teams, 6 July 2023
  • 2. Agenda • What are APIs? • Advantages of APIs • Practical demonstration of APIs
  • 3. What is an API? More importantly why should you care?
  • 5. Data wrangling sucks • Spreadsheets are presentational, not designed for analysis • Cross tabs typically only have two dimensions • Got to re-interpret the column headers, unpivot the data • Contains more data than you need • Not value add!
  • 6. Application Programming Interfaces • A set of rules and protocols that allows software and data sources to communicate • Standards-backed, e.g. HTTP Methods (information transfer), HTTP Status Codes (like 200 Okay 401 Unauthorized), JSON, XML • Can be accessed using URLs which contain your request details (a HTTP GET) or with a JSON file a (HTTP PUT)
  • 7. Some useful APIs (Not just for reading data!) • The ONS Census and CMD API: https://developer.ons.gov.uk/ • The NHS Fingertips API: https://fingertips.phe.org.uk/api • HMRC’s suite of APIs: https://developer.service.hmrc.gov.uk/api- documentation/docs/api • DWP’s suite of APIs: https://www.api.gov.uk/dwp/#department-for-work-and- pensions
  • 8. APIs are a set of procedures to access data There may be lots of new terms here, but consuming APIs is risk- free. The worst outcome of a bad API call you’ll experience from an ONS API is that it didn’t understand your query. Photo by Kevin Fitzgerald on Unsplash
  • 9. Advantages of APIs Why should you use APIs?
  • 10. Why you should use APIs • Formatted for analysis • Filtered for your patch • No transformation errors • Automated updates • Real-time data (depends!) • Enriched data sources • Increased efficiency • Enhanced quality • Collaboration and sharing • Agility and adaptability
  • 11. Using or not using an API is your choice Configuring a service to use an API may take a bit more effort but you’ll get all of that time back and then some. Photo by Bernd 📷 Dittrich on Unsplash
  • 13. Notes about this demonstration • This demonstration is using Visual Studio Code, a free Integrated Developer Environment, and Python a programming language • The examples are configurable, and the presentational document will be available after this session • This example is more advanced than the autumn sessions, but it is necessary to demonstrate how the ONS Census API works • PowerBI and Tableau can consume APIs directly, and interpret the API’s responses in JSON for you • Programming in Python will not be required • Being familiar with how the API structures data helps you think about your requests

Editor's Notes

  1. Formatted for analysis: no more wrangling and copy/pasting from excel spreadsheets Filtered for your patch: no more downloading all of England’s data to report on Salford No transformation errors: the API returns data in the format you request, meaning you won’t make a mistake wrangling and get incorrect analysis Automated updates: when new data is released, the connections still work so you just need to refresh the API; if you are working with time series this is especially good Real-time data: It may be true that real-time data is available from an API most analysis ONS Local performs isn’t real time (i.e. live), it’s generally a programmatic view of a static set of observations which get updated monthly, etc. An example of a realtime dataset is Manchester’s Oxford Road Cycle Counter which is updated each time a cyclist passes a set point Enriched data sources: APIs can return detailed information and notes at almost any level: so instead of a warning on the note section about a set of observations, it’s specific to the exact scope but doesn’t ruin your spreadsheet with symbols or footnotes in an observation cell with the value you want. You can’t sum up observations when the values 3, 4, 5, and x. Increased efficiency: set it and forget it. APIs are versioned, which means when you program against a version of an API, it will continue to work even if the data updates; no more broken spreadsheets. API developers will release a whole new API version (i.e. v2 after v1) if they’re going to introduce any changes which will break v1 functionality Enhanced quality: The Census API has perturbation, and there are other advantages Collaboration and sharing: Imagine being able to provide access to all of the UK’s census information but just with a link, the power you get with an internet connection and not having to download the large amounts of data locally – not that you would be allowed to access the microdata – means it’s easier to collaborate Agility and adaptability: As these datasets are filterable fully custom, ad hoc analysis is just selecting the new analysis. Is the report originally ethnicity vs age for a local authority’s wards, but someone wants to see highest level of education obtained vs age, it’s just changing one parameter!