
import urllib.request
import json

#where to save reteived defintions
#if None than no files are saved
savepath = "."

#Your API key for Big Huge Thesarus
APIkey = ""

def thesarus(word):
	if(savepath):
		try:
			return json.load(savepath+word)
		except:
			print("No file found in "+savepath+" for "+word)
		web = urllib.request.urlopen("http://words.bighugelabs.com/api/2/"+word+"/json")
		jsonobj = json.loads(web.read())
		if(savepath):
			json.dump(jsonobj,savepath+word)
		return jsonobj


import urllib.request
import json

#where to save reteived defintions
#if None than no files are saved
savepath = "."

#Your API key for Big Huge Thesarus
APIkey = ""

def thesarus(word):
	if(savepath):
		try:
			return json.load(savepath+word)
		except:
			print("No file found in "+savepath+" for "+word)
		web = urllib.request.urlopen("http://words.bighugelabs.com/api/2/"+APIkey+"/"+word+"/json")
		jsonobj = json.loads(web.read())
		if(savepath):
			json.dump(jsonobj,savepath+word)
		return jsonobj

Use API key in URL
Use API key in URL
  
  import urllib.request
  import json
  
  #where to save reteived defintions
  #if None than no files are saved
  savepath = "."
  
  #Your API key for Big Huge Thesarus
  APIkey = ""
  
  def thesarus(word):
  	if(savepath):
  		try:
  			return json.load(savepath+word)
  		except:
  			print("No file found in "+savepath+" for "+word)
- 		web = urllib.request.urlopen("http://words.bighugelabs.com/api/2/"+word+"/json")
+ 		web = urllib.request.urlopen("http://words.bighugelabs.com/api/2/"+APIkey+"/"+word+"/json")
  		jsonobj = json.loads(web.read())
  		if(savepath):
  			json.dump(jsonobj,savepath+word)
  		return jsonobj
  
Use API key in URL
## Code Before:

import urllib.request
import json

#where to save reteived defintions
#if None than no files are saved
savepath = "."

#Your API key for Big Huge Thesarus
APIkey = ""

def thesarus(word):
	if(savepath):
		try:
			return json.load(savepath+word)
		except:
			print("No file found in "+savepath+" for "+word)
		web = urllib.request.urlopen("http://words.bighugelabs.com/api/2/"+word+"/json")
		jsonobj = json.loads(web.read())
		if(savepath):
			json.dump(jsonobj,savepath+word)
		return jsonobj

## Instruction:
Use API key in URL
## Code After:

import urllib.request
import json

#where to save reteived defintions
#if None than no files are saved
savepath = "."

#Your API key for Big Huge Thesarus
APIkey = ""

def thesarus(word):
	if(savepath):
		try:
			return json.load(savepath+word)
		except:
			print("No file found in "+savepath+" for "+word)
		web = urllib.request.urlopen("http://words.bighugelabs.com/api/2/"+APIkey+"/"+word+"/json")
		jsonobj = json.loads(web.read())
		if(savepath):
			json.dump(jsonobj,savepath+word)
		return jsonobj
