Skip to main content

Nobel Prize headlines and API - 02/03/2023

🍩 Let’s use crul to extract headlines from

/* Open the nobelprize webpage */
/* filter for elements containing the string "headline" in the "parentElement.attributes.class" column */
|| contains parentElement.attributes.class headline

🍩 Now onto the API. Here’s a query that will get us a full list of all Nobel Laureates since the award’s inception.

/* make an initial api request to the nobelprize api */
api get
/* build a range of values for pagination using the "meta.count" value as our max */
|| range 0 $meta.count$ page --step 25
/* expanding request for laureates using the page column to determine the offset*/
|| api get$page$
/* results are in an array, expand the laureates array column into row per array entry*/
|| normalize laureates

Try adding || countOf to the end of the query to get a count of laureates by country of birth. Then use the attributes modal to find the column name of the birth city and get a count of laureates by city of birth.