Your question is Traverse Nested API Response Graph. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a starting endpoint ID start_id and a mapping api_map where each endpoint returns a JSON-like object with data and children, collect all data values reachable from start_id. Each children list contains IDs of other endpoints to visit. Return the collected data values in breadth-first traversal order, visiting each endpoint at most once even if multiple parents reference it.
data and childrenapi_mapdef collect_api_data(start_id, api_map):