KeyError: 'data' in get_highlights()
Author: kakarotoCreated Mar 15, 2025Updated Sep 28, 2026
Labelsbugstale
Describe the bug
I haven't tried this tool before, so I don't know when it stopped working, but highlights cannot be downloaded as of today, as I keep getting a KeyError: 'data' crash.
To Reproduce
This happens when using the library on the get_highlights API, as well as using the CLI tool with --highlights argument.
python instaloader.py --login XXXX instagram --no-metadata-json --highlightsExpected behavior Download of highlights from the user profile
Error messages and tracebacks
Traceback (most recent call last):
File "v:\instaloader-master\instaloader.py", line 6, in <module>
main()
File "v:\instaloader-master\instaloader\__main__.py", line 584, in main
exit_code = _main(loader,
File "v:\instaloader-master\instaloader\__main__.py", line 302, in _main
instaloader.download_profiles(
File "v:\instaloader-master\instaloader\instaloader.py", line 1532, in download_profiles
self.download_highlights(profile, fast_update=fast_update, storyitem_filter=storyitem_filter)
File "v:\instaloader-master\instaloader\instaloader.py", line 81, in call
return func(instaloader, *args, **kwargs)
File "v:\instaloader-master\instaloader\instaloader.py", line 969, in download_highlights
for user_highlight in self.get_highlights(user):
File "v:\instaloader-master\instaloader\instaloader.py", line 938, in get_highlights
data = self.context.graphql_query("7c16654f22c819fb63d1183034a5162f",
KeyError: 'data'Instaloader version Version 4.14.1 Also tried git master as well as the branch from PR #2533 which had fixed some other issues I was having, but not the highlights one.
Additional context
I did a quick edit of the code to print out the return value from the graphql_query and this is the response:
{'errors': [{'message': 'execution error', 'code': 1675002, 'summary': 'Incorrect Query', 'description': 'The query provided was invalid.', 'extensions': {}, 'severity': 'CRITICAL'}], 'status': 'ok'}Source: instaloader/instaloader