Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
halcyon57a
New Member

Extract API info from Notebooks

Hi I am using the Fabric API to trawl through all workspaces on a tenant, identifying Python notebooks and trying to read these to see if they access an API.  If one exists, then list it out.   The Notebook I am running lists the workspaces correctly, correctly identifies whether the Notebook exists and tries to extract the API data - but it doesn't.  It just returns blanks.  Any one ever done this ? Any thoughts?

 

6 REPLIES 6
V-yubandi-msft
Community Support
Community Support

Hi @halcyon57a ,

When you have a moment, please let us know if everything is okay on your end or if you need any further assistance.

 

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @halcyon57a ,
Can you let us know whether your issue has been resolved or if you're still having trouble? Your feedback is important and could assist others with similar concerns.

 

Thank You.

V-yubandi-msft
Community Support
Community Support

Hi @halcyon57a ,

May I know if the issue has been resolved, or are you still facing any challenges? Please let us know if you need any additional details or assistance.

 

Thanks.

anilgavhane
Resolver III
Resolver III

What Might Be Going Wrong

Here are some common culprits:

  1. Notebook Content Access Limitations
    • The Fabric API can list notebooks, but reading their internal code cells isn't always straightforward. If you're using the REST API to fetch notebook metadata, it may not include the actual code content unless explicitly supported.
    • Notebook Format
      • Fabric notebooks are stored in a proprietary format, not plain .ipynb. So unless you're parsing the actual notebook file correctly, you might just be getting metadata (like name, ID) but not the code itself.
      • Authentication Scope
        • If you're using a Service Principal, make sure it has the right permissions to access notebook contents. Some API endpoints may still be limited in preview and not support full content extraction.
        • Code Parsing Logic
          • Even if you're getting the code, your script needs to scan for patterns like requests.get(...), http.client, or urllib to detect API calls. If the code uses custom wrappers or indirect methods, it might slip past your filters.

             

            🛠️ Suggested Approach

            Here’s a more robust strategy:

V-yubandi-msft
Community Support
Community Support

Hi @halcyon57a ,

Thank you for your post in the Fabric community, and  In addition to @tayloramy  earlier response. Fabric’s public API does allow you to retrieve complete notebook definitions, including all code cells. If you’re only getting metadata, that could be why the results appear blank you need to use the correct endpoint for full content.

You can refer to the official documentation: Manage and execute Fabric notebooks with public APIs - Microsoft Fabric | Microsoft Learn

 

This guide explains how to list notebooks, access their full content, and handle formats such as .ipynb, .py, and .sql. For .ipynb notebooks.

Regards,
Yugandhar.

tayloramy
Solution Sage
Solution Sage

@halcyon57a can you post the snippet of your code that is not working as expected? 

Helpful resources

Announcements
September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors