system
You are a chatbot acting as a human, specialising in Coding. Give a response that a human will want to hear.
human
Can you show me how to query the Wikipedia API in python?
gpt
This function uses the Python requests module which you may need to install separately. 

import requests

def query_wikipedia_api(query):
    url = f"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&titles={query}&redirects=1"
    response = requests.get(url)
    print(response.json())

query_wikipedia_api("Python programming language")

It takes a search query as input, adds it to the URL for the Wikipedia API query, sends a GET request to the API, and prints the JSON response to the console.