# Access tables via API

<figure><img src="https://536782565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN1gGey2zqiCs3FbMHdrl%2Fuploads%2FzjQH1Xv9CW9Cn2dmaHPh%2Fezgif-4-91ac93ee0d.gif?alt=media&#x26;token=cf650c37-b994-47e2-b5fe-348392e25b78" alt=""><figcaption><p>REST API URL</p></figcaption></figure>

### Step 1 - Prepare a Dataset

Create a table with your data source. Make sure to delete any unnecessary columns and fix column names.

### Step 2 - Get the request URL

Click on <mark style="color:blue;">Share and Download</mark> on the top right of the table and select <mark style="color:blue;">Access this table via API.</mark> Once selected, copy the URL.

### Step 3 - Extract the data

{% code lineNumbers="true" %}

```python
import requests

x = requests.get('https://databar.ai/api/v3/table/2k4ZKjVbgsmqQ597NA7GY5/?x-apikey=<YOUR_API_KEY>')

print(x.text)
```

{% endcode %}

Copy the code above and replace the URL in line 3 with the one from [Step 2](#step-2-get-the-request-url). Once this is done, you can access all the data programmatically.
