GAPI

Response shape

The same object comes back from every platform. Fields that do not apply are returned as null rather than being left out, so your parser never has to check whether a key exists.

Which fields are always present, which are optional, and which stay null

Top level

FieldTypeNotes
platformstringAlways present — the network the link came from
typestringvideo, image, album or audio
titlestring | nullThe caption, when the post has one
authorstring | nullSet where the source exposes it; null on Instagram
thumbnailstring | nullPreview image; not returned for Instagram carousels
durationnumber | nullSeconds, where the source reports it
mediaarrayAlways present, always at least one item

Inside media

FieldTypeNotes
typestringvideo, image or audio
urlstringDirect link to the file — always present
qualitystring | nullSet where several renditions exist, e.g. 720p
extstring | nullFile extension, where the source reports it

Writing against it

data = response.json()

if data["type"] == "album":
    print(len(data["media"]), "files")

for item in data["media"]:
    download(item["url"])