# Quickstart: Run a Wells App in Python

Complete the steps below and you'll have a simple Wells app that fetches a list of wells on your company's Petro.ai instance and lists related data.

To run this quickstart example you'll need:

  • Access to the internet and a web browser, in order to authorize the example app.
  • A Petro.ai account with at least one well in your database.
  • An Python environment with requests and pprint installed.

You can check you've connected with the following script:

import requests as r
from pprint import pprint

# Step 1: Enable access to Petro.ai

First we'll need to get connected, we'll use the app token described in Authentication. With those credentials we can now connect to your Petro.ai. Fill out the AppIds below.

## Using App ID
appid = '7d54ac3f46493ff662f224e1ab2f1642'
apikey = 'b082c84e856987a9cb7ac9500ac54fc9'

# Step 2: Making the Request

We're going to get petrons from the API using the data endpoint. It will look something like:

url = 'https://yourcompany.petro.ai/api/data/query'

With that, we can fetch the first 10 petrons in the database.

resp = r.post(url,
    auth = (appid, apikey),
    json = {
        "type": "petron",
        "query": {},
        "options": { "limit" : 10 }

# Next Steps

If your goal is to expand the getting started example into something for your own app, consult the API Reference. The API Reference discusses all of the features of the Petro 5 API.