Web APIs Exercises#

Section Title: Web APIs Exercises

Question-1#

Retrieve the advice with the ‘id’ number equal to 123 using the Advice Slip API.

Question-2#

Choose 10 random ‘id’ numbers between 100 and 200 using the numpy.random.randint() function, and print the corresponding advice messages if they contain fewer than 30 characters using the Advice Slip API

Question-3#

Find the date of the advice slip containing the word “better” and having an id number closest to 100 using the Advice Slip API

Question-4#

Generate random latitude and longitude values for 20 different locations within the following ranges: latitude from -90 to 90 and longitude from -180 to 180.

  • Use the Open-Meteo API to retrieve the temperature data for these locations.

  • Plot each location as a point on a graph, with the size of the point proportional to the absolute value of the temperature.

  • Assign red to the points representing negative temperatures and blue to those with positive temperatures.

Question-5#

Request one week of hourly temperature data for New York using the Open-Meteo API and calculate the descriptive statistics of the temperature values, including max, min, mean, median, and standard deviation.

Question-6#

Request the latitude and longitude values of 10 cities using the OpenWeather API, and then plot the locations of these countries on a coordinate system.