Skip to content

Instantly share code, notes, and snippets.

@M0r13n
Created June 16, 2019 10:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save M0r13n/24b55f838d085409ca4050a15c1b27aa to your computer and use it in GitHub Desktop.
Save M0r13n/24b55f838d085409ca4050a15c1b27aa to your computer and use it in GitHub Desktop.
How to query the hexbot api
import requests # install if necessary -> pip install requests
URL = 'https://api.noopschallenge.com' + '/hexbot' # change the last part to query different machines
r = requests.get(URL)
result = r.json()
print(result['colors'][0]['value']) # prints the hex code, e.g. #7A5A28
# Additional parameters
# Hexbot supports: count, width, height, seed
params = {'count': 5, 'width': 1000, 'height': 1000}
r = requests.get(URL, params=params) # the requests module will handle the parameter encoding
result = r.json()
print(result) # prints a list of hexcodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment