Forum Academy Marketplace Showcase Pricing Features

Update db data with API

Hello - looking for some help with an API/db question. I’ve tried and tried to figure this out; I’ve scoured the Forum and found related posts (below) but none had replies. I’ve Googled, YouTubed, NuCode, and more. Any input would be awesome.

I have an API for sports games that has nested values for the games. The data in the API updates two different ways:

  1. Each game has a game number, the first game listed is game 0, then game 1, etc. After game 0 concludes, game 1 becomes game 0 in the data, game 2 becomes game 1, etc.
  2. Data about a specific game updates throughout the week; for instance game 0 might have a point spread of 5 today, but tomorrow it’ll be 6.

Once a game is over, it’s gone from the API too

Here is a snapshot of the json

I can get the first run into the database for the games. When I run it again afterwards, it just makes duplicate entries. I need a way to run (several) times and have it look up the game by like the gameUID, and then just change certain fields, or something similar.

Any help/tips would be so appreciated.
JTF