---
# System prepended metadata

title: auto search

---

# auto search

```python=
import urllib.request
from urllib.parse import quote
import json
import string

def search():
    url = "https://www.googleapis.com/customsearch/v1?key=[你的API Key]&cx=[你的Search Engine ID]&q=vtuber+福利卡&start=0&num=10"

    url = quote(url, safe=string.printable)

    print(url)

    res = urllib.request.urlopen(url).read()
    dic = json.loads(res)

    print(dic["items"][0]["title"])

search()
```