Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to find Database Id for my database in Notion?

Tags:

notion-api

I have been using notion to track my habits and my finances. Now I want to get the data from the database using the Notion API. But the notion API requires Database ID and I can't seem to find it.

like image 299
Atul Bhatt Avatar asked May 27 '21 18:05

Atul Bhatt


People also ask

How do I find the database ID in Notion?

📘 Notion offers linked databases as a way of showing databases in multiple places. You can identify them by a ↗ next to the database title which, when clicked, takes you to the source database.

Can you put a database in a database in Notion?

Relational databases are a way to connect up the databases you use inside of your Notion. Databases allow you to add tables, calendars, gallery, list and board view for managing projects and activities and connecting them up can be useful when importing information to your account.


2 Answers

The official documentation is probably outdated or at least not working for UK users.


If your URL looks like below, then <long_hash_1> is the database ID and <long_hash_2> is the view ID.

https://www.notion.so/<long_hash_1>?v=<long_hash_2>
                                  

You must share the database with your integration! Click the share button in your database view, find your integration name and switch on the toggle next to it.


If you still haven't found your URL, you can get it from either the web client or an APP client:

  • If you are using the web client, go to the database view (e.g. board view), and the URL is can be found in your browser's address bar.
  • If you are using APP client, go to the database view (e.g. board view), and click/tap the share button. Copy the invite link (lower bottom corner as in Windows APP) and the link is your URL.
like image 165
Anthony Avatar answered Oct 16 '22 05:10

Anthony


If this is just for yourself, you can get the database ID from the URL of the page:

  • If you're using the Notion desktop app, click on the Share button once again and select Copy link. Paste and navigate to this URL in your browser. You may need to log into the Notion workspace if you haven't already. Follow the instructions for the browser in the next bullet.

  • If you're using Notion in a browser and viewing the database as a full page, the database ID is the part of the URL after your workspace name and the slash (acme/) and before the question mark (?). The ID is 32 characters long, containing numbers and letters. Copy the ID and paste it somewhere you can easily find later.

https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
                                  |--------- Database ID --------|

If you are creating an integration for others, you can use the Search endpoint to get all databases your integration has access to. There is also a List databases endpoint, but apparently this is deprecated.

like image 13
Jan Fabry Avatar answered Oct 16 '22 05:10

Jan Fabry