Import a CSV file using command line interface

Use our command-line utility to import data from CSV file

📘

Information below might be outdated - please visit our recently updated API Reference

1. Install python

You need a Python interpreter to run the console importer. Please download it from this website: https://www.python.org/

2. Install importer

pip3 install shortcm-client

3. Run the command

For example, you have this CSV file (file.csv):

Long URLShort pathPage titleCreated timeSalesperson email
http://yourlongdomain.com/yourlonglinkexample1Webpage title2019-10-13T21:27:25+03:00[email protected]
http://yourlongdomain.com/yourlonglink2example2Webpage title2019-10-13T21:27:25+03:00[email protected]

To import the file you need to run a command with these parameters:

shortcm --secret-key <<apiKey>> csv-import --filename file.csv \
    --domain <<domain_name>> --path-column 1 --original-url-column 0 \
    --title-column 2 --created-at-column 3

Required parameters are secret-key, filename, domain original-url-column.