Import Omie Data to Google Sheets

In this guide, we’ll walk through how to pull data from the Omie API directly into Google Sheets, using the API Connector add-on for Sheets.

We'll first get an API key from Omie, and then set up a request to pull in Brazilian electronic service invoice (NFS-es) data to your spreadsheet.


Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your Omie API Key and Secret

  1. Sign in to Omie and click the Gear icon
  2. Scroll down the page until you see your API key and API secret
  3. Keep these handy as we'll use these shortly. You're all set! You can now connect to Omie's API.

Part 2: Pull Omie API Data into Sheets

For this example, we'll make a request to the /servicos/nfse/ endpoint (see all endpoints in the documentation)

  1. Open up Google Sheets and click Extensions > API Connector > Open > Create request.
  2. In the request form enter the following:
    • ApplicationCustom
    • MethodPOST
    • Request URL
    • Headers:
      • Content-Type: application/json
    • Request body: {"call":"ListarNFSEs","app_key":"your_api_key","app_secret":"your_api_secret","param": [{"nPagina": 1,"nRegPorPagina": 500}]}
  3. Create a new tab and click Set current to use that tab as your data destination.
  4. Name your request and click Run. A moment later you’ll see Omie data populate your sheet.

Part 3: Handle Pagination

By default, Omie returns just 50 records unless you set the "records per page" parameter in the request body to 500. The name of the pagination parameter depends on the endpoint; for example, the ListarClientes endpoint uses pagina and registros_por_pagina (for "page number" and "records per page"), while the ListarNFSEs endpoint uses nPagina and nRegPorPagina.

Please check the documentation to ensure you've configured your request with the correct pagination parameters.

ListarClientes Example

  • Pagination typepage parameter body
  • Page parameter bodyparam[].pagina
  • Run untilchoose when the request should stop running

ListarNFSEs Example

  • Pagination typepage parameter body
  • Page parameter bodyparam[].nPagina
  • Run untilchoose when the request should stop running

Part 4: API Documentation

Official API documentation:

Leave a Comment

Jump To