Skip to content

Instantly share code, notes, and snippets.

@MatMoore
Created September 3, 2018 16:12
Show Gist options
  • Save MatMoore/463420ec6434dfce4188aa5c8a726da5 to your computer and use it in GitHub Desktop.
Save MatMoore/463420ec6434dfce4188aa5c8a726da5 to your computer and use it in GitHub Desktop.
GOV.UK taxonomy
#!/usr/bin/env ruby
require 'faraday'
require 'json'
response = Faraday.get 'https://www.gov.uk/api/content'
homepage = JSON.parse(response.body)
level_one = homepage['links']['level_one_taxons'].map do |item|
item["api_path"]
end
def expand(api_path)
response = Faraday.get 'https://www.gov.uk' + api_path
content_item = JSON.parse(response.body)
item = content_item.slice("title", "content_id", "base_path")
children = content_item["links"].fetch("child_taxons", []).map do |child|
child["api_path"]
end
return item.merge("children" => children)
end
indent = " "
level_one.each do |level_1|
level_1 = expand(level_1)
puts "#{level_1["content_id"]} (#{level_1["title"]})"
level_1["children"].each do |api_path|
expanded = expand(api_path)
puts indent + "#{expanded["content_id"]} (#{expanded["title"]})"
end
puts ""
end
e48ab80a-de80-4e83-bf59-26316856a5f9 (Government)
ccd41790-a498-4cd1-a510-125d67e0f585 (Public sector land use)
8a98b827-82ad-49b4-819e-82c208c551c4 (National security)
f3f4b5d3-49c4-487b-bd5b-be75f11ec8c5 (Government efficiency, transparency and accountability)
3afd1d79-597d-4f97-bc7a-83766dcab2f4 (Europe)
78c2148c-a7cd-448b-8105-9f78ded119d1 (Emergency preparation, response and recovery)
383f2d71-b239-4d90-b89b-600340b34332 (Public services)
90c9b9f1-0a4f-4639-b1e9-2bfb23d611bd (Government technology and digital services)
d6c2de5d-ef90-45d1-82d4-5f2438369eea (Brexit)
95d06252-5d75-42fb-9c5c-038ab6b482e4 (Democracy)
dfe808c3-6a58-4266-8f50-a93d931bfaaf (Government reform )
c2367fdf-a8ca-403f-950c-88ebc3879fec (Government content and publishing)
67f50352-bc30-482f-a2d0-a05714e3cea8 (Cyber security)
ba3a9702-da22-487f-86c1-8334a730e559 (Entering and staying in the UK)
18c7918f-cde5-4e66-b5f4-cd15c33cc1cc (Travel and identity documents for foreign nationals)
fa13521f-9285-45b0-bd65-4a472a8037e7 (Immigration offences)
6dc91505-fdbd-4b6b-9bd5-fef3dc8baf42 (Immigration adviser services)
6e85c12f-f52b-41b3-93ad-59e5f19d64f6 (Rights of foreign nationals in the UK)
f48188df-8130-4d36-98e0-e72125d016a2 (Visas and immigration corporate)
262e9ea7-90fc-4ac8-8aa7-fc294282a1d4 (Border control)
c64eb759-93ff-4bfd-86f2-16753fc1e062 (Immigration rules)
08a8a69f-2825-4fe2-a4cf-c83458a5629e (Refugees, asylum and human rights)
29480b00-dc4d-49a0-b48c-25dda8569325 (Visas and entry clearance)
fef7e737-6f1a-4ef4-b844-aa24b630ad03 (Permanent stay in the UK)
37d0fa26-abed-4c74-8835-b3b51ae1c8b2 (International)
d6dba75a-42bd-4e1e-984c-2bddb6b41951 (Foreign affairs)
9fb30a53-70fb-4f1c-878b-0064b202d1ba (International aid and development)
cb7db7bb-d0b4-4e22-9f0b-58a28c2db38c (Human rights internationally)
d376bc0d-6c47-4399-b1bf-d9adefa47df0 (UK prosperity and security: Asia, Latin America and Africa)
b1c19cf1-7533-480b-97e2-ab4c4812c7fa (Anti-corruption)
6a10a7ae-4729-4941-9889-c2330b6a893b (The Commonwealth)
c7fded2a-fedc-4977-be5d-efd4f6a34a73 (Sexual violence in conflict)
8124ead8-8ebc-4faf-88ad-dd5cbcc92ba8 (Health and social care)
7d67047c-bf22-4c34-b566-b46d6973f961 (Social care)
c66d9ec0-0455-4cd2-9cc5-becb226206fb (End of life care)
08899d00-fd62-43ce-9704-0e71796d063b (Carers' health)
d69977ab-4fb1-4ad6-b379-e967c5b7528b (Disabled people)
30ba2d05-d0d6-4978-a5d6-707511894111 (Health protection)
3d796637-9c22-4b65-a24f-a01a31586fbb (Population screening programmes)
cebc01ee-f70a-4397-a552-622e10b62508 (Medicines, medical devices and blood regulation and safety)
d6a4884e-769d-4b81-8ba5-b64394362d92 (Public health)
f3dcc290-752f-4bbe-b379-9155d919a58d (National Health Service)
7c1c4dbe-d925-4071-965f-8779d504bd47 (Screening and quality assurance (all programmes))
ba951b09-5146-43be-87af-44075eac3ae9 (Crime, justice and law)
1fb1ae8d-c975-43ba-9672-13ee0993e98b (Young people and the law)
e9926d96-9bfd-4d8f-ad4e-301254216298 (Statutory rights)
ed952e5a-2ea7-44c0-aed9-c97ffe58993b (Your rights and the law)
7f4eaf37-60f8-4d8c-a968-7829098e05ff (Crime prevention)
1dd3f25a-9237-4143-b2d2-cd7f6863c9c0 (Prisons and probation)
4919a97c-3249-496c-8485-b7c8d36d6ef0 (Legal aid)
fa5b3b7e-682a-49fd-bf99-d2cfe3e16a26 (Reporting crimes and getting compensation)
357110bb-cbc5-4708-9711-1b26e6c63e86 (Courts, sentencing and tribunals)
165bfd10-8402-4719-b38e-62ca618d3b8f (Counter-terrorism)
ff10faa5-1bc0-41a4-8629-d528915ad7e4 (Policing)
587fd3ee-c009-4a49-8b30-557300c55bd1 (Knife, gun and gang crime)
459b36eb-65f0-43a6-95ab-f3fb0bdaff50 (Reoffending and rehabilitation)
1906f68c-2d10-4182-9a0f-31a1f7d77c29 (Legal aid reform)
15492103-227c-47c4-bb98-0380458b81df (Attorney General guidance to the legal profession)
783cf728-cd63-47ce-aa63-b466b2ea3982 (Forced marriage)
a15cc825-5319-40a9-8396-0153920f8f0b (Domestic violence)
cade4e7d-0397-459d-a880-3d2753dd39c2 (Law and practice)
fae66b20-eacd-4a41-a417-81cae5fa4b8c (Family justice system)
afd65c1c-dee0-4f5b-8bd6-4f502e4870af (Justice system transparency)
756613a3-522d-4402-beb9-532b5708ba74 (Violence against women and girls)
23100f5c-25d2-4d3f-8a63-f32e619a32d5 (Criminal justice reform)
7ed17bb3-42cd-432a-80fa-c4ee82ad4f2a (Civil justice reform)
6cbc4c56-f412-4116-bd2f-66dfbdcd94ae (Criminal record disclosure)
d1b7471b-bdd1-4719-9376-b79d2f854807 (Victims of crime)
70505387-138c-431c-a82d-94ff81f97e18 (Sentencing reform)
66f7bd95-7e8b-4f33-ad7f-77a13ae92d49 (Administrative justice reform)
562132d3-7f14-46e8-953b-d7e0d56cf021 (Byelaws)
17b10a3e-2530-49cc-8cf6-1e002458b0b0 (Data protection)
6acc9db4-780e-4a46-92b4-1812e3c2c48a (Money)
5605545e-03ca-4520-9519-163ea341bc86 (Expenses and employee benefits)
7c4cf197-2dba-4a82-83e2-6c8bb332525c (Court claims, debt and bankruptcy)
a7b67f4f-1234-4a0c-90ba-eeed4c5183cd (Money laundering regulations)
28262ae3-599c-4259-ae30-3c83a5ec02a1 (Business tax)
b20215a9-25fb-4fa6-80a3-42e23f5352c2 (Dealing with HMRC)
a5c88a77-03ba-4100-bd33-7ee2ce602dc8 (Personal tax)
35136812-221c-4ba2-8ed1-46e409ca5e10 (Tax evasion and avoidance)
503c5bc7-809a-47b9-83e2-bd0c212dbabb (Regional and local government)
f2c9ec1e-bbdd-45b8-afd7-fab0c9371d4b (Devolution)
c914fd40-dd0a-45c4-a6ff-bce0cda31bde (Local government)
68ad6c84-49fd-4871-95bc-5bd48c0f81e1 (Wales)
3b643153-c4ff-45aa-b923-0be70b083071 (Local government spending)
a1e624ed-e268-44ab-ac3f-4d3cb2bb8cb5 (Northern Ireland)
88b0ec49-b8fc-4fbb-8418-68b88719b8c8 (Localism)
e2aac912-93c5-4b19-bd3d-9c12676e985c (Scotland)
15191831-40b4-4f6e-ade3-e82d7c775afd (Local councils and services)
3cf97f69-84de-41ae-bc7b-7e2cc238fa58 (Environment)
71f685fe-0dc3-469d-92c2-1000ad86d7d9 (Flooding and coastal change)
f4e9e92d-9192-4e17-90c6-553339bc04c3 (Waste and recycling)
a1efce91-28c3-4a33-a2fd-48364b1119a4 (Environmental quality)
e36116dd-69c2-481f-8deb-02d5a207f9cc (Boating and inland waterways)
8f75f298-8126-47d4-8da1-ed67c4ecb39c (Biodiversity and ecosystems)
3894b4d1-bb7f-4c3d-a680-c904ccabd91e (Sustainable development)
4e561949-4a26-49c2-918d-6ad2972c4d33 (Environmental permits)
42fdd045-cadf-474b-b8a6-ca20a77c43bb (Marine)
c419f70a-0986-4f55-b766-3a19216a3e5a (Land management)
a5152a79-8583-4297-bb61-289cd0c2bd37 (Assessing environmental impact)
bed98e5c-3ad1-41fe-9f7a-71361ea572a8 (Environmental risk management)
5a0e03ab-8825-46e7-a0ab-a83808e19412 (HS2 and the environment)
cb4c8377-6fcb-4022-a7a1-98395eb50508 (Water industry)
1218dda2-9279-4fec-840c-1321cb1a8934 (Oil and gas)
b14a6778-60a2-483a-924c-774d1040cbf4 (Commercial fishing and fisheries)
d6af3ac9-e252-4e13-a673-405125797219 (Coal)
62e08e6f-9161-42c6-b9dd-0cf8fcab2c69 (Climate change and energy)
52ff5c99-a17b-42c4-a9d7-2cc92cccca39 (Food and farming)
9949c2c1-ff96-4b4f-b584-c700e316c9de (Rural and countryside)
d304dcea-c3f6-4b56-859c-6409a8712111 (Wildlife and animal welfare)
e2ca2f1a-0ff3-43ce-b813-16645ff27904 (Society and culture)
0bb6e269-4c6d-432d-96b6-f2b343a7603c (Charities, volunteering and honours)
0d74fa5d-e56e-4765-904e-2337fa46218e (British citizenship )
668cd623-c7a8-4159-9575-90caac36d4b4 (Community and society)
b29cf14b-54c6-402c-a9f0-77218602d1af (Arts and culture)
f9e476ef-654d-41ec-97d9-2b6842d4361d (Sports and leisure)
3506d46e-62d7-4602-93f5-fcb9bb2aade8 (National events and ceremonies)
b297e49c-7da4-4bc1-8714-da80fa0758d3 (Equality, rights and citizenship)
2e444a6b-c6b5-4c7b-a66a-d7e059914979 (Loneliness)
96c479bc-9b6c-49d3-8e86-3821f43a6fb0 (Tourism)
9597c30a-605a-4e36-8bc1-47e5cdae41b3 (Going and being abroad)
d96e4efc-9c26-4d9b-9fa7-a036b5c11a65 (Travel abroad)
27b9c5cd-b390-4332-89be-73491df35a41 (Passports)
3dbeb4a3-33c0-4bda-bd21-b721b0f8736f (British nationals overseas)
d956c72a-246d-4787-af39-00bf58b2ea66 (Living abroad)
c58fdadd-7743-46d6-9629-90bb3ccc4ef0 (Education, training and skills)
dd767840-363e-43ad-8835-c9ab516633de (Further and higher education, skills and vocational training)
db605204-0f03-441b-837f-16613c6b3f8f (Pupil wellbeing, behaviour and attendance)
ff00b8b2-dcdb-4659-93c2-291c9be354f3 (Teaching and leadership)
f0dcb0b9-2f2c-46b0-adea-42a4fe608170 (Inspections and performance of education providers)
d2005b89-352f-4896-aced-1d17504330e6 (Education of disadvantaged children)
a8bffaae-5c8c-439f-92f0-c9fbf32ce1d9 (Starting and attending school)
42e6e5c3-3a06-4a6f-abd4-a4b85d9c6b16 (Running and managing a school)
1a26ae19-00f2-4be1-b9b6-aa72876a0278 (School and academy financial management and assurance)
23265b25-7ec3-4960-8517-4ff8d4d92cac (Funding and finance for students)
7c75c541-403f-4cb1-9b34-4ddde816a80d (School curriculum)
47b6ce42-0bfa-42ee-9ff1-7a9c71ee9727 (Special educational needs and disability (SEND) and high needs)
90e8a226-8d40-4c1f-91e4-36a712b34e57 (School and academy funding)
206b7f3a-49b5-476f-af0f-fd27e2a68473 (Parenting, childcare and children's services )
1423ec9f-d62c-40f7-b10e-a2bdf020d8b7 (Divorce, separation and legal issues)
f1d9c348-5c5e-4fc6-9172-13a62537d3ae (Childcare and early years)
a44b1c68-807c-45fe-bc7b-a47586617863 (Financial help if you have children)
5a9e6b26-ae64-4129-93ee-968028381e83 (Adoption, fostering and surrogacy)
2389dfd4-a0c4-4bd2-b7e6-06f465463d22 (Children's health and welfare)
43fcdde6-59c5-487f-a969-a046b334cbec (Youth employment and social issues)
e4335adc-5dc3-47c0-bb27-4998792212eb (Pregnancy and birth)
20eb4e84-98ee-404b-a4bd-fe8a36d5d71d (Safeguarding and social care for children)
a544d48b-1e9e-47fb-b427-7a987c658c14 (Corporate information)
4794066e-e3cc-425e-8cc4-e7ff3edb4c39 (Housing, local and community)
82730dd2-4ead-4ae6-943b-2c910e758279 (Land registration)
4ad66168-274d-4d83-9195-f4ab0ccc97cb (Housing)
e3147d4f-4bd5-4a14-a386-4ba7ccb058b4 (Planning and building)
dded88e2-f92e-424f-b73e-6ad24a839c51 (Welfare)
7a1ba896-b85a-4137-81d9-ab05b7ce67dd (Child Benefit)
05a9527b-e6e9-4a68-8dd7-7d84e6a24eef (Carers and disability benefits)
a4822791-855a-4f14-877a-e199b5c58126 (Child maintenance reform)
ac7b8472-5d09-4679-9551-87847b0ac827 (Death and benefits)
29dbee2a-5865-489b-860f-7eef54a5165a (Benefits for families)
6c4c443c-2e11-4d25-aa93-2e3a38d9499c (Heating and housing benefits)
a7f3005b-a3cd-4060-a127-725accb54f2e (Tax credits)
536f83c0-8c67-47a3-88a4-d5b1eda591ed (Benefits entitlement)
2a1bd1b1-5025-4313-9e5b-8352dd46f1d6 (Jobseeker's Allowance and low income benefits)
62fcbba5-3a75-4d15-85a6-d8a80b03d57c (Universal Credit)
76b03d8c-e5cc-4ba0-8630-c7cc71fb87ad (Welfare reform)
d0f1e5a3-c8f4-4780-8678-994f19104b21 (Work)
460718d9-82e4-40a7-bbe8-8824a4a05590 (Secondments with government)
0133b1b3-9ecd-48ad-b226-538b46a17ff4 (Government graduate schemes)
24e91c04-21cb-479a-8f23-df0eaab31788 (Self-employment)
4c18a195-9b74-4882-8d11-bf224ceb8292 (Labour market reform)
36c7772d-f1ef-4506-a9af-be366bf49af4 (Health and safety reform)
5b9686c9-eaf8-48bd-9351-5fac0e721a02 (Work and disabled people)
092348a4-b896-4f8f-a0dc-e6d4605a4904 (Working, jobs and pensions)
374b4837-cf2a-4529-a7f1-559d92b3d90d (Payroll)
6df55cf4-d25c-41d2-aec9-824c67a9eb51 (Pensions and ageing society)
5f1f5537-e9e6-488d-85f6-bd91327987ec (Trade unions)
20086ead-41fc-49cf-8a62-d4e1126f41fc (Life circumstances)
0a018d28-e3a8-4db7-a593-c8a0bfb57319 (Having a child, parenting and adoption)
f875c256-b84a-417a-b2b5-ff7e301a41c7 (Certificates, register offices, changes of name or gender)
6bf58181-7ebe-4599-8a93-281f9b7af810 (Lasting power of attorney, being in care and your financial affairs)
fe0b40e6-f742-45b0-9b2c-2cb976ce18ad (Marriage, civil partnership and divorce)
0fffa994-b76d-4539-8bf9-2a6c6751580d (Death and bereavement)
a4038b29-b332-4f13-98b1-1c9709e216bc (Transport)
230a94c8-362a-4e3f-9a83-823472aa202a (Transport modelling and appraisal)
4d72b9fa-a11a-485e-9c22-8fb426e0feaa (Transport accessibility and mobility)
13d01427-33b5-4ca4-bf7a-68425f54e236 (Rail)
82e9e133-20aa-424d-bc61-f30b29e2d05b (Transport planning)
02a5bdc0-9a62-4286-9128-c923845fa1c5 (Transport security)
d39a3eae-b358-4472-83e2-2e17a86e2ad8 (Corporate and operational information (transport))
84a394d2-b388-4e4e-904e-136ca3f5dd7d (Driving and road transport)
3e4df71e-474d-4a40-bd6a-b3072affa151 (Freight and cargo)
95202728-fb55-4aac-a53e-6a8f1553348a (Road infrastructure)
3767d89c-b00c-431e-8b0b-b91c8ff26238 (Careers in transport)
4a9ab4d7-0d03-4c61-9e16-47787cbf53cd (Maritime and shipping)
51efa3dd-e9bc-42b2-aa26-06bf5f543015 (Aviation)
3b4d6319-fcef-4637-b35a-e3df76321894 (Local transport)
e491505c-77ae-45b2-84be-8c94b94f6a2b (Defence and armed forces)
8ff8cf05-a6e6-4757-a896-4fabd9f3229a (Armed forces)
1f21cce7-fc86-433c-a79b-1a4f0acb5a3a (Support services for veterans and their families)
e4b9e05a-6c04-4e18-945f-4584c08c4628 (Support services for military and defence personnel and their families)
72241f43-600b-4c34-9205-5a07060a2711 (Military awards and commemorations)
e33ce727-bb6b-47a2-894b-b7174cb7faee (Ministry of Defence estate)
4b9f1f6f-0c16-4a99-94e5-e58a3fba461f (Military recruitment, training and operations)
ac5d432a-11a9-40e1-bb83-0de26106b9d6 (Military equipment, logistics and technology)
9f183c2c-2256-42d7-a12d-ced7b7f24195 (International defence commitments)
735f4865-8b48-4ea8-99c2-94f121839367 (Stability in the Western Balkans)
8f589b76-f3ee-4eca-adf6-2ad70807ad8c (Armed forces and Ministry of Defence reform)
253c217e-5d8e-4ec6-acfb-e5165674cac5 (Armed forces support for activities in the UK [P])
761b3ded-bc40-498e-8964-d31c9664970a (Weapons proliferation [P])
268c139d-8d58-43ed-85f4-19c511e283e7 (Armed Forces Covenant)
d6fc8b39-351d-4d3f-a938-4a86f38906bc (UK nuclear deterrent [P])
45c29c6b-1bc4-4b3b-af9d-0d05e019269d (Nuclear disarmament)
495afdb6-47be-4df1-8b38-91c8adb1eefc (Business and industry)
8aa41155-58ff-4d7d-a11a-7e3ef42863dd (Running a business)
544a5fe2-b97c-4239-a6be-620469146a8b (Corporate governance)
33bc0eed-62c7-4b0b-9a93-626c9e10c025 (Business regulation)
13fb7519-c48e-4577-90f8-aaf483fa0c03 (Business and the environment)
4ef6d013-ec2d-4ae8-a1a0-5a984e6e6c42 (Media and communications)
d7e02519-b7ba-4297-80a8-01cd0e5f2cb2 (Financial services)
80cb30f4-0361-49ea-ad84-bc10910318bf (Charities and social enterprises)
ccb77bcc-56b4-419a-b5ce-f7c2234e0546 (Science and innovation)
ed2ca1f7-5463-4eda-9324-b597e269e242 (Trade and investment)
d34ba9b3-28d8-40d5-a2d3-f52d216c2590 (Manufacturing)
a1e4659c-dc15-48be-bc4f-6c609ae061dc (UK economy)
74f7449e-08f8-4325-b8db-3703cb99f4d0 (Industrial strategy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment