USDA FDC unique identifiers - fdc_id, NDB Number, Food Code

I’m a bit confused by the different unique identifiers. All foods seem to have a unique fdc_id. However, these ids seem to be a bit unstable. For example, in the October 2020 Version of the Database the foundation food “Apples, red delicious, with skin, raw” had the fdc_id=1105430. In the April 2021 Database this food is a “HISTORICAL RECORD”: [FoodData Central] and there is a new “Apples, red delicious, with skin, raw” with fdc_id=1750339. As a developer using your API this change of the fdc_id is a bit inconvenient if I want to get the newest version of the food. I somehow have to now if there is a new entry for the same food but different id. I wonder why the old food with fdc_id=1105430 hasn’t simply be updated but instead a new one was created?

There also is the NDB Number which seems to be more stable as both apples have the NDB Number 9500. What is this number? What does the abbreviation NDB mean? Will the NDB Number be stable for future version of the database so that a mapping can be done between same foods which have different fdc_ids?

Is the food_code of Survey Foods (FNDDS) the equivalent to the NDB Number of SR Legacy Foods and Foundation Foods? Will it also be stable in the future even if the fdc_id changes?

Answer from USDA:

FDC ID is not a persistent identifier, it may change when a food is updated. For example, when we have an update for a Foundation food item, the FDC ID will change when we update details about that food (ex. apples, red delicious, with skin was updated with new individual sugar data, therefore got a new FDC ID but the ndb number remained the same). The persistent/stable identifier for SR Legacy and Foundation Foods is the NDB number, Survey foods is the “Food Code”, for Branded foods is “upc/gtin”. NDB number stands for ‘Nutrient DataBase number’ which was the identifier used in the previous USDA nutrient database. We hope this information helps!