item is most likely a string in your code; the string indices are the ones in the square brackets, e.g.,
gravatar_id. So I’d first check your
data variable to see what you received there; I guess that
data is a list of strings (or at least a list containing at least one string) while it should be a list of dictionaries.