Excel Online API Python

How to use the Excel Online API using Python.

code How to use the Excel Online API using Python

There are two ways to do this:

  1. Directly use the Excel Online API. The downside of this being it takes a significant amount of time to learn and setup all the configuration.
  2. Just use sheet2api. This takes care of all that configuration for you, all you need is the URL to your Excel Online spreadsheet to get started.

Easy setup

  1. 1 Install the Python package with pip.
    pip install sheet2api
  2. 2 Run Excel Online API request with Python.
    from sheet2api import Sheet2APIClient
    
    client = Sheet2APIClient(api_url='https://sheet2api.com/v1/FgI6zV8qT121/characters/')
    client.get_rows()
  3. 3 Create and use your own sheet2api API.

code Examples

Here are some ready to use Excel Online API examples using the Python client. Simply copy them into your project and you're good to go.

Read all rows

# Returns all rows from the first Sheet.
from sheet2api import Sheet2APIClient

client = Sheet2APIClient(api_url='https://sheet2api.com/v1/FgI6zV8qT121/characters/')
client.get_rows()

Read rows which match search terms

# Returns all rows from the first Sheet, filtered by search terms.
from sheet2api import Sheet2APIClient

client = Sheet2APIClient(api_url='https://sheet2api.com/v1/FgI6zV8qT121/characters/')
client.get_rows(query={'name': 'Bugs Bunny'})

Add a new row

# Adds a new row to the Sheet.
from sheet2api import Sheet2APIClient

client = Sheet2APIClient(api_url='https://sheet2api.com/v1/FgI6zV8qT121/characters/')
client.create_row(row={'Name': 'Bugs Bunny', 'Favourite Thing': 'Carrots', 'Image': 'Bugs.png'})

For more in-depth examples check out the Github code repository.

check_circle It's as easy as that! 🎉

Need help? Feel free to reach out via our contact page.

Start using sheet2api now

Be up & running in seconds.

Try for FREE
check_circle No credit card required
check_circle Cancel anytime