Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How do you meaningfully use it without using scraping APIs? Aren't the official apis severely limited?




Google Programmable Search Engine [1] is pretty good if your needs are within their usage limits.

[1] https://programmablesearchengine.google.com/about/


That's the one I use, yeah! You set it up here:

https://programmablesearchengine.google.com/controlpanel/cre...

And then it's just a GET:

    import os
    import json
    from req import get

    url = "https://customsearch.googleapis.com/customsearch/v1"

    def search(query):
        data = {
            "q": query,
            "cx": os.getenv('GOOGLE_SEARCH_API_KEY'),
            "key": os.getenv('GOOGLE_SEARCH_API_ID')
        }
        results_json = get(url, data)
        results = json.loads(results_json)
        results = results["items"]
        return results



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: