13.5 What’s in a Tweet?

The Twitter API methods return JSON objects. JSON (JavaScript Object Notation) is a text-based data-interchange format used to represent objects as collections of name–value pairs. It’s commonly used when invoking web services. JSON is both a human-readable and computer-readable format that makes data easy to send and receive across the Internet.

JSON objects are similar to Python dictionaries. Each JSON object contains a list of property names and values, in the following curly braced format:

{propertyName1: value1, propertyName2: value2}

As in Python, JSON lists are comma-separated values in square brackets:

[value1, value2, value3]

For your convenience, Tweepy handles the JSON for you behind the scenes, converting ...

Get Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.