← 返回 ibm 的题目列表Retrieve and Filter Elite Clubs from Football Teams API
类型:online_judge
Write an API request tool to retrieve a list of the top five clubs by estimated monetary value from a database of football clubs in a specified nation. The database is accessed via GET requests and the API URL template is https://jsonmock.example.com/api/football_teams?nation={nation_name}. The results are paginated. Ensure the returned clubs are filtered not only by providing valuation data but also by conforming to the pagination structure of the API query response.
Requirements:
Use HTTP GET requests to retrieve data from the given URL.
The API response data structure includes the following fields:
page: current page number
per_page: maximum results per page
total: total number of records
total_pages: total number of pages for the query
data: an array of JSON objects containing club information
The data structure for each object includes:
name: the club's name
nation: the nation the club plays in
estimated_value_numeric: the monetary value of the club
number_of_league_titles_won: the number of league titles won by the club
Filter and return the list of the top five clubs sorted by estimated monetary value in descending order.
Provide test cases and sample input/output.
Example
Input
England