web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Read/Extract data from Dynamics CRM Sales via Python

(2) ShareShare
ReportReport
Posted on by 4

Hello all,

I am very new to Dynamics CRM and have a question. Is there a way to read data from  the dynamics CRM sales database via Python script?

Thanks a lot for your help.

I have the same question (0)
  • Dengliang Li Profile Picture
    Microsoft Employee on at
  • Suggested answer
    fabipfr Profile Picture
    13 on at
    I developed a python package for that. It leverages pandas DataFrames to handle easy data transformations, imports or exports which is what you're looking for. 
     
    The repository and Readme is here:
    https://github.com/fabipfr/DataversePython/blob/main/README.md

    this package contains a get_rows() method where you can filter and choose columns to export. 
    check my blog for detailed examples of the function:

    https://blog.fabianpfriem.com/2025/08/how-to-getrows-in-dataversepython.html
     
    Installation: pip install DataversePython

    hope this helps :)
     
  • Suggested answer
    DAnny3211 Profile Picture
    11,421 Super User 2026 Season 1 on at
     

    Hi there,

    Yes, you can read data from Dynamics CRM (now part of Dynamics 365) using Python by leveraging the Web API provided by Microsoft.

    Here’s a general approach:

    1. Register an App in Azure

    • Go to the Azure Portal and register an application.
    • Assign the necessary API permissions for Dynamics CRM.

    2. Authenticate via OAuth2

    • Use libraries like msal or requests in Python to authenticate and obtain an access token.

    3. Use the Dynamics Web API

    • The base URL typically looks like:
      https://<your_org>.crm.dynamics.com/api/data/v9.2/
    • You can then send GET requests to endpoints like:
      accounts, contacts, opportunities, etc.

    Example Python Snippet

     
    import requests
     
    headers = {
        'Authorization': 'Bearer <access_token>',
        'Content-Type': 'application/json',
        'OData-MaxVersion': '4.0',
        'OData-Version': '4.0'
    }
     
    url = 'https://your_org.crm.dynamics.com/api/data/v9.2/accounts'
    response = requests.get(url, headers=headers)
    data = response.json()

    Let me know if this helps, and please mark the response as helpful if it answered your question 😊

    Best regards!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 101 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 83

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans