---
updatedAt: 2026-07-27T10:39:32.000Z
agentTools:
  projectIndex: https://developers.dailymotion.com/v0/llms.txt
---

# Mass upload from an Excel file using Python SDK

<Callout icon="🚀" theme="default">
  ### API v2 now available

  Visit the <Anchor target="_blank" href="https://developers.dailymotion.com/v2/reference/introduction">API v2 documentation</Anchor> or follow the <Anchor target="_blank" href="https://developers.dailymotion.com/v2/docs/migrating-from-legacy-api-to-api-v2">migration guide</Anchor> to upgrade.
</Callout>

<br />

Our REST API allows “Mass Upload” for customers who need to transfer large video catalogs to Dailymotion. One of the easiest ways is to upload files via an Excel file.

Follow this tutorial to know how to use a Python library that will automatically upload your videos.

***

## 1. Create the Excel file

First step: create your Excel file. This very simple document must include specific information about your videos:

* Titles
* URLs
* Tags
* Channels (the video category)
* Descriptions
* Is it already published? (true/false)
* Is it created for kids? (true/false)

<br />

<Callout icon="👍" theme="okay">
  ### Template

  Use this <Anchor target="_blank" href="https://corpostatic.dailymotion.com/corporate-cms-upload-assets-prod-aws/uploads/sites/150001/2022/02/be4ce080-c91b-11e9-9b6d-31334e74cc7e-mass-upload-type-file.xlsx">Excel template</Anchor> to list the videos you want to mass upload.
</Callout>

***

## 2. Upload using Python

Now that your Excel file is created, you need to integrate it in your Python code. For that, we suggest you to use <Anchor target="_blank" href="https://openpyxl.readthedocs.io/en/stable/">Openpyxl</Anchor>. This open-source Python library can read and write Excel 2010 xlsx, xlsm, xltx and xltm files.

<Callout icon="⚠️" theme="warn">
  ### API Key

  Our Python SDK uses the <Anchor target="_blank" href="https://developers.dailymotion.com/v0/docs/authenticate-using-password-grant-type">password grant type</Anchor>. As a result you must use a <Anchor target="_blank" href="https://developers.dailymotion.com/v0/reference/authentication-api">Public API Key</Anchor>
</Callout>

```python
import importlib
from openpyxl import load_workbook

# -----------------------------------------
# Dailymotion SDK import (due to the "-" in module name)
# -----------------------------------------
_DAILYMOTION = importlib.import_module("dailymotion-sdk-python.dailymotion")

# -----------------------------------------
# Dailymotion credentials
# -----------------------------------------
_API_KEY = "YOUR_API_KEY"
_API_SECRET = "YOUR_API_SECRET"
_USERNAME = "YOUR_DAILYMOTION_LOGIN"
_PASSWORD = "YOUR_DAILYMOTION_PASSWORD"

# -----------------------------------------
# Excel loading
# -----------------------------------------
_FILENAME = "Videos.xlsx"
_XLS = load_workbook(_FILENAME)

# Change the sheet name if needed
_SHEET = _XLS["Sheet1"]

# -----------------------------------------
# Adding columns for returned API info
# -----------------------------------------
_DM_XID = _SHEET.cell(
    row=1,
    column=_SHEET.max_column + 1,
    value="Dailymotion xid"
)

_DM_URL = _SHEET.cell(
    row=1,
    column=_SHEET.max_column + 1,
    value="Dailymotion link"
)

# -----------------------------------------
# Instantiate the Dailymotion SDK client
# -----------------------------------------
_DM = _DAILYMOTION.Dailymotion()

try:
    # Authentication
    _DM.set_grant_type(
        "password",
        api_key=_API_KEY,
        api_secret=_API_SECRET,
        scope=["manage_videos"],
        info={"username": _USERNAME, "password": _PASSWORD},
    )

    # -----------------------------------------
    # Loop through rows (skip headers)
    # -----------------------------------------
    for row in _SHEET.iter_rows(min_row=2, max_row=_SHEET.max_row):
        
        # Upload the file to Dailymotion servers
        file_path = row[1].value
        url = _DM.upload(file_path)

        # Prepare video data
        parameters = {
            "url": url,
            "title": row[0].value,
            "tags": row[2].value,
            "channel": row[3].value,
            "description": row[4].value,
            "published": row[5].value,
        }

        # Create the video
        result = _DM.post("/me/videos?fields=id,url", parameters)

        # Write new values
        _SHEET.cell(
            row=row[0].row,
            column=_DM_XID.column,
            value=result["id"]
        )
        _SHEET.cell(
            row=row[0].row,
            column=_DM_URL.column,
            value=result["url"]
        )

    print("Upload from Excel file to Dailymotion completed successfully.")
    _XLS.save(_FILENAME)

except Exception as e:
    print(f"An error occurred: {e}")
```

With this code, <Anchor target="_blank" href="https://developers.dailymotion.com/v0/docs/python-sdk">our Python SDK</Anchor> will upload your videos to Dailymotion and include all information from your Excel file. The upload time will mostly depend on the size of your files. To help you keep track of the process, you will receive a script every time a new video is uploaded.

<br />

<Callout icon="⚠️" theme="warn">
  ### Rate limits and larger video catalogs:

  <Anchor target="_blank" href="https://developers.dailymotion.com/v0/reference/rate-limiting">API rate limits</Anchor> caps the number of videos you can upload per day. To check your current limits at the video level, you can request the `limits` field on your channel using the API: `/user/<CHANNEL_ID>?fields=limits` (authentication required).

  To upload **larger video catalogs**, please reach out to your Dailymotion Account Manager or to our <Anchor target="_blank" href="https://faq.dailymotion.com/hc/requests/new">Support team</Anchor>.

  Find more info on <Anchor target="_blank" href="https://faq.dailymotion.com/hc/articles/115009082668">other “Mass Upload” options</Anchor>.
</Callout>

<br />