<s> from urllib2 import Request , urlopen <EOL> import json <EOL> api_key = '<STR_LIT>' <EOL> endpoint_template = '<STR_LIT>' <EOL> fetch_endpoint = endpoint_template % '<STR_LIT>' <EOL> fetch_input = { <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT:url>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } <EOL> headers = { <EOL> '<STR_LIT>' : api_key , <EOL> } <EOL> request = Request ( fetch_endpoint , data = json . dumps ( fetch_input ) , headers = headers ) <EOL> response_body = urlopen ( request ) . read ( ) <EOL> fetch_output = json . loads ( response_body ) </s>
