Systers, an AnitaB.org community

Call an API using Python (Mentorship-Backend)

Prerequisites:

  1. Install Python 3.x - (How to)
  2. Use PIP to install requests module - (How to)

Steps:

  1. Create a new Python script file
  2. Learn how to call a Wikipedia API by following this tutorial
  3. Make a call to the Wikipedia Search API ((example)[https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=Craig%20Noone&format=json]) using Python's 'requests' module in your script
  4. Convert the response of the API from JSON to Python Dictionary variable and print response
  5. Create a new public Gist on Github
  6. Paste your Python script file code in the new Gist
  7. Share URL of Gist

Resources:

Work Submission:

Share the link of the Publicly accessible Gist that you have created. To check if it is publicly accessible, try opening the link in an Incognito Window or in a browser without your GitHub account logged in.

The shared links to screenshots should remain public till end of GCI 2019.

Task tags

  • python
  • api
  • requests
  • wikipedia-api
  • backend

Students who completed this task

adv, ABSOLUTEunit, AI_Ranger, ns0631, oliverfogelin, kyoukiros, Fitz Watson, Pooja, IMINABO ROBERTS AYIBO, BartekPacia

Task type

  • code Code

Level

Beginner
close

2019