I would like to retrieve data from an API (Soccer Players). As this data changes regularly, it doesn’t make sense to store it into the DB. Rather, I would like to retrieve the Data flexibly and display it into my application. (This step works already)
I would like my users to store the data type “Reports” to a specific player. As the player data is not stored in my DB, but pulled from the API instead, how would I go about this? The player data from the API doesn’t contain a UID, so I thought about connecting it to the “name” and save the player name to the report. However, this feels a bit inelegant. Any ideas?
Please share the API you’re using. I’ve worked with API-Football in the past. They use player ids.
I would highly recommend using an API that has ids built in. That way, you can simply GET a specific player’s data when needed. No storage required other than a player id.
I use the APIFY Transfermarket Scraper and managed find the ID now for a player. The plan is to get the API Data, let the user create a report, save the ID to the report and retrieve the player data again by searching/filtering the API result. Seems to be working so far.
OK in this case only thing you can do is to use player name as an ID. You could concatenate First Name & Last Name so it’s more complex string and the chance of 2 players having the same full name is really low.