Skip to content

How to bulk shorten links from a CSV or spreadsheet

Shorten hundreds of URLs at once from a CSV or spreadsheet: the column layout that works, a dry run before anything is created, and the API, CLI and QR options.

By Shortlen Editorial Updated 9 min read

An API request creating short links in bulk
The short answerPut one long URL per row in a CSV with a header such as url,title,tags,alias, then import it. In BN Shortener the import reads up to 1,000 rows per file, shows a dry-run preview before anything is created, scans every destination and gives you a CSV of the new short links. Developers can send up to 1,000 links per API request instead.

Key takeaways

  • A clean CSV needs one column only, the long URL; title, tags, alias, campaign and expiry are optional extra columns.
  • Always run a dry run first: it shows which rows will be created, renamed or skipped before anything happens.
  • BN Shortener imports up to 1,000 rows per file; split bigger lists into several files.
  • Every imported link counts toward your plan's new links per month, so check the allowance before a large import.
  • For code, POST /api/v1/links/bulk takes up to 1,000 links per request; the bn command line turns a file of URLs into a CSV of short links in one command.
  • Need printed codes too? Bulk QR creates up to 2,000 dynamic QR codes (URL or vCard) from one CSV and exports them as ZIP files with a codes.csv.

To bulk shorten links, put your long URLs in a CSV file, one per row, and import it into your shortener instead of pasting them one at a time. This guide shows the CSV layout that works first time, the import steps in BN Shortener (the service behind Shortlen), and the three other routes: the API, the bn command line and bulk QR codes.

Which bulk method should you use?

Your situationBest routeLimit per run
A spreadsheet of URLs, no codeDashboard import1,000 rows
Moving from Bitly, Rebrandly, Short.io, TinyURL or DubDashboard import of their CSV export1,000 rows
A script, a product feature or a nightly jobAPI POST /api/v1/links/bulk1,000 links per request
A terminal or CI jobbn bulk urls.csvone file
Printed codes for each URLBulk QR from CSV2,000 rows
A handful of URLs while you are chatting with an assistantMCP tool bulk_create_links100 URLs per call

All of them create normal short links: each destination is threat-scanned, each link gets a 4-character code (a link like b1.lc/AbC9) or the alias you asked for, and each counts toward your plan’s new links per month (100 on Free, 1,000 on Pro, 10,000 on Business).

How should the CSV be laid out?

Use a header row and one link per row. Only the destination is required:

url,title,tags,alias,campaign
https://shop.example.com/shoes?color=red,Red shoes,spring,red-shoes,Spring 2026
https://shop.example.com/bags,Bags,spring,,Spring 2026
"https://shop.example.com/search?q=boots,winter",Boots search,winter,,

What the columns mean, and the other names the import recognises:

ColumnAlso recognised asNotes
url (required)destination, long_urlFull address with https://, up to 2,048 characters
titleLeave empty and the page title is used
tagslabelsUsed for filtering in My Links
aliasback-half, slug, slashtag3 to 50 letters, digits, - or _; leave empty for a random code
campaigngroup, folderCampaigns are created by name if they do not exist
expiryLeave empty for links that never expire
notesInternal notes

Rules that prevent most failed imports:

  • Quote any field that contains a comma, as in the third row above. That is the CSV standard (RFC 4180): fields containing commas, double quotes or line breaks go inside double quotes, and a double quote inside a field is written twice.
  • Save as UTF-8. In Excel choose CSV UTF-8 in the Save as type list; in Google Sheets use File > Download > Comma-separated values. BN handles a UTF-8 byte-order mark, and comma, semicolon or tab separators.
  • Keep the full URL, including https://. A bare shop.example.com/shoes is not a valid destination.
  • Add UTM tags before you import if you want them. Build one template link with the UTM builder and copy the pattern down the column, so every row uses the same spelling.
  • Aliases are case-insensitive and must be unique. Red-Shoes and red-shoes are the same code. Reserved words such as admin, login or pricing cannot be used.

How do I import a CSV in BN Shortener? Step by step

  1. Sign in at b1.lc (or start free; no card is needed).
  2. Open the import. In the dashboard go to Settings, Data & Privacy, Move Your Links. The public switch page explains the same flow for people moving from another shortener.
  3. Upload the CSV. Up to 1,000 rows per file. Column names are matched automatically.
  4. Read the dry run. Before anything is created you see a preview: which rows will be created, which codes are kept, which will be renamed, which will be skipped and why. Fix the file and upload again if anything looks wrong; nothing has been created yet.
  5. Choose what happens on a conflict. Old codes are kept when they are free (the default). If a code is taken, choose a new code or skip the row.
  6. Import. Every destination is threat-scanned; dangerous ones are refused.
  7. Download the mapping file, a CSV of old code to new short link. Paste the short links back into your spreadsheet or hand the file to whoever is building the email, the print run or the ad set.
  8. Run Launch Check on the batch. Imports are not checked automatically. Select the new links (or the campaign) and run a bulk Launch Check: up to 200 links per run, three at a time, and it keeps running on BN’s servers if you close the tab.
A list of existing links moving into a Shortlen workspace, with a CSV preview
The import reads your CSV, shows a dry-run preview, then creates the links.

Moving from another shortener

The same import reads the CSV exports of Bitly, Rebrandly, Short.io, TinyURL and Dub without editing. Tags, titles, campaigns (by name) and expiry dates come along, and the original creation date is kept in each link’s notes. Click history stays with the old service. If your old links were on your own domain, add the domain in BN Shortener before you move its DNS, so the old codes keep working on it.

For SDKs, the n8n node and the command line, see the integrations page. POST /api/v1/links/bulk takes a links array of up to 1,000 objects, each with the same fields as creating a single link (url, custom_code, domain, title, tags, and so on). The answer has one result per item, in order, with index, success and, when it worked, data.short_url. One bad URL does not fail the whole request.

This Python script reads a CSV with a url column (and optional title), sends it in chunks of 1,000 and writes the results to a new CSV:

import csv, json, os, time, uuid, requests

API = "https://b1.lc/api/v1/links/bulk"
HEADERS = {"X-API-Key": os.environ["BN_API_KEY"]}

with open("urls.csv", newline="", encoding="utf-8-sig") as f:
    rows = [r for r in csv.DictReader(f) if r.get("url")]

with open("short-links.csv", "w", newline="", encoding="utf-8") as out:
    writer = csv.writer(out)
    writer.writerow(["url", "short_url", "status"])
    for start in range(0, len(rows), 1000):
        chunk = rows[start:start + 1000]
        links = [{"url": r["url"], **({"title": r["title"]} if r.get("title") else {})} for r in chunk]
        idem = str(uuid.uuid4())                      # reused if this chunk is retried
        while True:
            resp = requests.post(API, json={"links": links},
                                 headers={**HEADERS, "Idempotency-Key": idem}, timeout=120)
            if resp.status_code == 429:
                time.sleep(int(resp.headers.get("Retry-After", 30)))
                continue
            resp.raise_for_status()
            break
        for item in resp.json()["data"]["results"]:
            source = chunk[item["index"]]["url"]
            if item["success"]:
                writer.writerow([source, item["data"]["short_url"], "created"])
            else:
                writer.writerow([source, "", json.dumps(item)])

Three things make it safe to run on a real list:

  • Idempotency-Key per chunk. If the connection drops after BN created the links, resending with the same key returns the first answer instead of creating 1,000 more. Stored answers are kept for 24 hours.
  • Retry-After on 429. Bulk endpoints have their own limit (50 requests a minute), separate from your plan’s general API tier.
  • Failures are reported per item, so you can fix and resend only those rows.

To import another shortener’s CSV export by API instead, send it to POST /api/v1/links/import, first with ?dry_run=1 to get the same preview as the dashboard. keep_codes and on_conflict (new_code or skip) control what happens to old codes. The import reference has the full request. For keys, errors and rate limits, see our URL shortener API guide.

How do I bulk shorten from the command line?

The bn command line is a single file you can download today from b1.lc/cli/bn (Python 3.9+, Linux, macOS and Windows, with a published checksum). After bn login:

bn bulk urls.csv > links.csv

The input is either one URL per line or a CSV with url,title,tags,code columns; the output is a CSV of short links. Add --json for machine-readable output. Because it sets exit codes, it fits in CI: run bn check on a link afterwards and the job fails when a link is not ready.

How do I create QR codes in bulk?

If each URL also needs a printed code (shelf labels, event badges, one poster per store), use bulk QR in the QR Codes section of the dashboard:

  1. Prepare a CSV with a name column (name or label) and a URL column (url, link, destination or website). Up to 2,000 rows. Rows can also be vCard contacts (first and last name, email and phone columns), and a folder column files each code.
  2. Upload it. Each URL row becomes a dynamic QR code, so you can change the destination after printing and every scan is counted.
  3. Optionally copy the design of an existing code so the whole batch matches your colours and logo.
  4. Download up to 200 codes at once as a ZIP, or export up to 5,000 as a ZIP prepared in the background; every ZIP includes a codes.csv listing each code. Formats are PNG, JPEG, WebP, SVG, PDF or EPS; use SVG, PDF or EPS for print, they are true vector files.

Up to 10 ZIP exports an hour are allowed per account. For design and print tips, see dynamic QR codes.

A printed card with a scannable QR code
Bulk QR makes one dynamic code per row, editable after printing.

What should I do after a bulk import?

The links exist; now make them easy to manage and report on:

  • Group them. Select up to 500 links in My Links and use the bulk bar to add or remove tags, set a campaign, set or remove an expiry, disable, enable or move to Trash. Every change is written to each link’s history.
  • Put them in a campaign if you did not use a campaign column, so clicks roll up into one report. See UTM builder and campaigns.
  • Check them before you send. Run Launch Check on the batch (step 8 above). It catches broken destinations, redirect loops, missing UTM tags and weak QR contrast before your audience does.
  • Keep the mapping file. It is the only record that ties each original URL to its short link outside BN.

The developer docs also describe a spreadsheet round-trip for editing existing links in bulk (download your links as CSV, change cells, upload with a dry run); see the import and export guide.

Common bulk import errors and fixes

SymptomLikely causeFix
Row skipped: invalid URLMissing https://, spaces, or a cell split by an unquoted commaAdd the scheme; quote fields with commas
Row renamedThe alias is already taken on b1.lcAccept the new code, choose another alias, or skip
Row refused for securityThe destination is on a threat listCheck the URL; do not force it through
Strange characters in titlesFile not saved as UTF-8Re-save as CSV UTF-8
Only part of the file importedOver 1,000 rowsSplit into several files
Plan limit reachedThe import would pass your new links for the monthImport fewer rows or wait for the next month
Brand-new account stops at 25A safety cap of 25 new links a day applies in an account’s first 7 daysImport the rest over the following days

Other tools offer similar routes; Short.io, for example, documents an API bulk endpoint of up to 1,000 URLs per call plus CSV and Google Sheets imports (checked 23 October 2026). What to compare is the dry run, how codes are kept on a migration, and whether every destination is scanned.

Start with one file

Create a free account at b1.lc, export your spreadsheet as CSV and run the dry run: you will see exactly what would be created before a single link exists. The Free plan includes 100 new links a month; Pro (1,000) and Business (10,000) are available now, listed on the pricing page.

Sources

  1. Import and export (guide), BN Shortener developer docs, undated. Checked 2026-10-23.
  2. Bulk Create Links (API reference), BN Shortener developer docs, undated. Checked 2026-10-23.
  3. Import Links (API reference), BN Shortener developer docs, undated. Checked 2026-10-23.
  4. bn command line, BN Shortener developer docs, undated. Checked 2026-10-23.
  5. RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) Files, IETF / RFC Editor, 2005-10. Checked 2026-10-23.
  6. How to shorten or create links in bulk, Short.io Docs, undated. Checked 2026-10-23.

Questions people also ask

How many links can I shorten at once?

In BN Shortener, one import file takes up to 1,000 rows, and one API bulk request takes up to 1,000 links. Your plan's monthly allowance of new links still applies: 100 on Free, 1,000 on Pro and 10,000 on Business.

What columns does the CSV need?

Only the long URL is required, in a column named url, destination or long_url. Optional columns such as title, tags, alias (or back-half, slug, slashtag), campaign, expiry and notes are recognised automatically, and the preview tells you which column it used for what.

Can I keep my old Bitly or Rebrandly back-halves?

Yes, when the code is free on b1.lc: the import keeps old codes by default. If a code is taken you choose whether it gets a new code or the row is skipped, and you can download an old-to-new mapping file afterwards.

Can I bulk shorten links in Excel or Google Sheets?

Yes. Keep the URLs in one column with a header row, then export the sheet as CSV (in Excel, choose CSV UTF-8 so accented characters survive) and import the file. Comma, semicolon and tab separated files are all accepted.

Will the import create duplicates if I run it twice?

Re-importing your own BN Shortener export never creates duplicates. For a fresh spreadsheet of URLs, run the dry run first and remove rows you have already shortened; for the API, send an Idempotency-Key so a retried request returns the first result.

Can I make QR codes in bulk from the same spreadsheet?

Yes. Bulk QR takes a CSV of up to 2,000 rows (web addresses or vCard contacts) and makes a dynamic QR code for each row, optionally copying the design of an existing code. Download up to 200 at once as a ZIP, or export up to 5,000 as a ZIP prepared in the background; every ZIP includes a codes.csv, and the files come in PNG, JPEG, WebP, SVG, PDF or EPS.

Try it on your next link

The Free plan includes a custom domain, 5 dynamic QR codes, a bio page and click analytics. No credit card.