Hi Hasnain – use the restatement_index
field in your query to know when restated facts exist.
This XBRL API fact
query shows the details for the two reports in your post (10-K and 10-K/A). I am using Apple CIK along with period details to filter, then sorting by the restated-index.
https://api.xbrl.us/api/v1/fact/search?entity.cik=0000320193&period.fiscal-year=2009&period.fiscal-period=Y&concept.local-name=EntityRegistrantName&fact.has-dimensions=false&fields=report.restated,report.restated-index.sort(ASC),report.type,period.fiscal-period,period.fiscal-year,concept.local-name,fact.value,report.accession,report.entry-url
Any fact appearing in a restated report will show report.restated as TRUE; the report.restated-index is an integer reflecting the number of times the report has been restated since the original filing (1).
Let me know if you still have questions about restatements in the Public Filings Database.