Skip to content

nimra200/Automating-Tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Getting-Started-with-APIs

This mini-project served as an introduction to using APIs in Python.

The program in word.py asks the user to input a word, and returns a few words commonly associated with it. When the given word is a noun, the most common adjectives describing the noun are also given. This file uses Datamuse API, which lets developers find English words that may be useful in a given context.

The program in send-sms.py sends an SMS to myself, informing me of how many people are currently in outer space.

Key concepts learned in this project:

  1. An API can be used in any programming language. It allows us to access tons of data and useful functions; we can use these functions in our own programs without worrying about how they were implemented.

  2. We can request the API for information. In this project, we needed a 'GET' request to retrieve data from a URL.

  3. The response of a request is formatted in JSON. For example, when we request the most common adjectives for a noun, JSON formats the data nicely for us, and the information becomes human-readable.

  4. All requests have a status code. The status code '200' tells us that everything was successful. A status code starting with '4' or '5' means something went wrong. A common example of this is '404 error: file not found'.

Resources

Prashanth Xavier and Josh Devlin have made incredibly helpful tutorials on getting started with APIs in Python.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages