Notion API returns incomplete property list when fetching database schema

I’m working with the Notion REST API to retrieve data from one of my databases, but I’m running into a strange issue. My database has 23 properties total, but when I make API calls to fetch the database or query its contents, I only get back 16 properties through the LIST DB endpoint. This means 7 properties are missing from the API response. I can see all 23 properties when I look at the database directly in Notion, so they definitely exist. Has anyone encountered this before? Is there a limit on how many properties get returned, or am I missing something in my API calls?

class NotionManager:
    def __init__(self):
        self.client = None
        self.db_collection = {}
        self.record_ids = []
        self.records = {}

    def setup_connection(self):
        with open('config.yaml') as file:
            config = yaml.load(file, Loader=yaml.FullLoader)
        
        API_KEY = config["api_key"]
        self.client = Client(auth=API_KEY)

    def get_databases(self):
        response = self.client.databases.list()
        print("Available databases: ")
        for db in response["results"]:
            db_name = db["title"][0]["plain_text"]
            print(db_name)
            self.db_collection[db_name] = db["id"]

    def fetch_database_records(self, db_name):
        database_id = self.db_collection.get(db_name)
        result = self.client.databases.query(database_id=database_id)
        
        for record in result["results"]:
            print(record)
            self.record_ids.append(record["id"])

    def get_individual_pages(self):
        for record_id in self.record_ids:
            page_data = self.client.pages.retrieve(page_id=record_id)
            print(page_data)

When I call get_databases(), I see 16 properties returned. When I use fetch_database_records(), I get 14 properties for individual pages. But the actual database has 23 properties. Why aren’t all properties showing up in the API response?

check your integration permissions first - notion’s api only shows properties your integration can access. i had the same issue where my bot saw 16 out of 25 properties because i forgot to grant read access to specific property types. go to notion.so/my-integrations and enable all property types, especially relations and people properties.

It’s Notion’s pagination system causing the problem, not just endpoint differences. When databases have lots of properties, the API automatically paginates them and you’ve got to handle the next_cursor parameter to grab everything. Your code’s missing pagination logic completely. I ran into this with a big database that had 30+ properties - the API was quietly cutting off my results. You need to modify your database retrieval to check for has_more: true in the response, then make more requests using the next_cursor value until you get all properties. Also heads up - some property types like formulas or rollups might not show up in certain API responses depending on how they’re configured.

You’re hitting the property limit on the databases.list() endpoint. Notion’s API behaves differently depending on which endpoint you use - list() only returns a subset of properties for performance reasons. You need databases.retrieve() with the specific database ID to get the complete property schema. Replace your get_databases() method with self.client.databases.retrieve(database_id=your_db_id) and you’ll see all 23 properties. I hit this exact same issue last month and switching to retrieve() fixed it instantly. The query endpoint has its own property handling logic too, which explains why you’re seeing different counts there.