This is my Python code + OAuth 2.0 Client ID API:
#!/usr/bin/env python
from urllib import request
import urllib
import urllib.parse
import json
import requests
client_id='xxxxxxx.googleusercontent.com'
client_secret='xxxxxxxxxxxxxxx'
query = 'site:xxxxxxxxx.com intitle:"linux" "vulnerability"'
dir_api='https://www.googleapis.com/customsearch/vi?key='
url=dir_api+client_secret+"&cx="+client_id+"&q="+urllib.parse.quote(query)
resultado = requests.get(url)
print( json.dumps(resultado.json, indent=4) )
The error that shows is:
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <bound method Response.json of <Response [404]>> is not JSON serializable
I can not find information on the subject. I have installed requests