(SOLVED: Solution is below the second graph)
Same period in the interactive chart of ^GSPC:

SOLVED
Apparently, Yahoo Finance API has different results for ^GSPC and GSPC.
(SOLVED: Solution is below the second graph)
Same period in the interactive chart of ^GSPC:

Apparently, Yahoo Finance API has different results for ^GSPC and GSPC.
Are you looking at the actual Close values or the Adjusted Close values in the API values? The Interactive chart shows the Adjusted Close values which account for dividends/splits/other corporate events. More on how Adjusted Close is calculated from actual Close here.