Get data from another website

I wanted to make an app which collects data from another website and displays it in my anvil web app. How can i do it ? Any suggestions

It can be done through an API. Many websites have API for developers. And the requests module is available in anvil. If you can tell which particular site you want to get data from, only then can someone help

Please have a look beautifulsoup as well

1 Like

i would like to get the data from google books api i just searched it up

If you are unfamiliar with google books api, here is something to help you get started


def search_google_books(self, search_term):
        import anvil.http
        import json
        search_term=search_term.replace(' ','+') #To ensure that spaces are supported in search
        a=anvil.http.request(f"https://www.googleapis.com/books/v1/volumes?q={search_term}")
        dict_a=json.loads(a.get_bytes().decode())
        print(dict_a)
1 Like