Skip to content

JOUR73351/my-first-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to use an API

Today we are going to learn how to use an API with Python. An an API stands for Application Programming Interface–think of it as a way for you to use code to fetch data. We will be using Pro Publica's Nonprofit API and NYC OpenData's API, but the concepts here apply to any API you find online.

Creating an account

  1. We will be exploring NYC 311 data.
  2. Create a new account by clicking on Sign up for an app token! or through their portal.
  3. Verify your email address.
  4. Create a new app token.
  5. Take note of your app token.
  6. Read the 311 API documentation and Socrata documentation.

Getting set up in pandas.

  1. Navigate to your data-journalism folder in terminal.

  2. Create a new folder for this project and move into that directory.

    mkdir my-first-api
    cd my-first-api
    mkdir notebooks
    mkdir output
    
  3. Install libraries we will need for this analysis.

    pipenv install jupyterlab
    pipenv install pandas
    pipenv install requests
    
  4. Start Jupyter Lab

    pipenv run jupyter lab
    
  5. Navigate to notebooks and create a Python 3 notebook inside of it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published