PHPackages                             shlinkio/shlink-importer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shlinkio/shlink-importer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shlinkio/shlink-importer
========================

Collection of tools to import links from different sources and map them to a shlink-compliant format

v5.8.0(3w ago)672.3k↑206.2%2[2 issues](https://github.com/shlinkio/shlink-importer/issues)1MITPHPPHP ^8.4CI passing

Since Oct 22Pushed 3w ago1 watchersCompare

[ Source](https://github.com/shlinkio/shlink-importer)[ Packagist](https://packagist.org/packages/shlinkio/shlink-importer)[ Docs](https://shlink.io)[ RSS](/packages/shlinkio-shlink-importer/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (27)Versions (25)Used By (1)

Shlink importer
===============

[](#shlink-importer)

Collection of tools to import links from different sources and map them to a shlink-compliant format.

[![Build Status](https://camo.githubusercontent.com/efcec2050bc5d64290c6abfb12e2ddf41db1c18dd959c637c2ae74036d06b4ab/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73686c696e6b696f2f73686c696e6b2d696d706f727465722f63692e796d6c3f6272616e63683d6d61696e266c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/shlinkio/shlink-importer/actions/workflows/ci.yml?query=workflow%3A%22Continuous+integration%22)[![Code Coverage](https://camo.githubusercontent.com/2e7e0e340b32b1810a98bf9417b12a16d827e62bd1b7aaf2eeac8bc7f0480cdd/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f73686c696e6b696f2f73686c696e6b2d696d706f727465722f6d61696e3f7374796c653d666c61742d737175617265)](https://app.codecov.io/gh/shlinkio/shlink-importer)[![Latest Stable Version](https://camo.githubusercontent.com/e6062e7b67ea4dc370abe598039cc3c4e15d3b553eb301a5dec2186da44f89af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73686c696e6b696f2f73686c696e6b2d696d706f727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shlinkio/shlink-importer)[![License](https://camo.githubusercontent.com/55288d6b78deb6b54f2e877f9ca0c922582d3dab4ae11b2c4c5033256945d48a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73686c696e6b696f2f73686c696e6b2d696d706f727465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/shlinkio/shlink-importer/blob/main/LICENSE)[![Paypal donate](https://camo.githubusercontent.com/f7bd7ab1d7bea7a4ac78f5189c56ce2dbf8cc73608863e0dd9408e10ddca4673/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d70617970616c2d626c75652e7376673f7374796c653d666c61742d737175617265266c6f676f3d70617970616c26636f6c6f72413d616161616161)](https://slnk.to/donate)

Installation
------------

[](#installation)

This module can be installed using composer:

```
composer require shlinkio/shlink-importer

```

Supported import sources
------------------------

[](#supported-import-sources)

#### Bit.ly

[](#bitly)

It imports using the API v4. The only required param is an [access token](https://bitly.is/accesstoken).

Only the URLs will be imported. Visits/clicks won't be imported yet (See [\#20](https://github.com/shlinkio/shlink-importer/issues/20)).

#### YOURLS

[](#yourls)

It imports using YOURLS API. However, since it has some missing capabilities, it requires a [dedicated plugin](https://slnk.to/yourls-import) to be installed in YOURLS.

The plugin covers the missing actions in the API, which allow Shlink to list the URLs and all their visits.

It will import short URLs and all their visits, but any information that YOURLS does not track (like the geolocation) cannot be obtained.

#### Kutt.it

[](#kuttit)

It imports using Kutt API.

It will import short URLs but not their visits, as Kutt.it does not expose individual visits but aggregate information, which is coupled with its UI and uses relative times.

#### Shlink

[](#shlink)

It imports from another Shlink instance using the API v2. Useful if you want to migrate to a different host or change the database engine.

You will have to provide the instance's base URL and a valid API key.

It will import short URLs and all their visits. However, it won't be possible to recalculate the location for those visits, so make sure to calculate the locations on the original instance first, by running `bin/cli visit:locate --retry`.

#### Standard CSV

[](#standard-csv)

It parses a CSV file with the `Long URL` and `Short code` columns. It can optionally contain `Domain`, `Title` and `Tags`, being the latter a pipe-separated or comma-separated list of items (`foo|bar|baz` or `foo,bar,baz`).

It is also supported that a `Short URL` column is provided, in which case the `Short code` and `Domain` will be inferred from it if not explicitly provided.

Column names can have spaces and have any combination of upper and lowercase.

This method does not allow importing visits due to its one-dimensional nature.

Usage
-----

[](#usage)

The module register the `short-url:import` command, which can be used to import links from different sources.

This command requires the source from which to import to be provided:

```
`bin/cli short-url:import bitly`

```

The command will ask you some questions about how to import from this source, and then, once the data is there, it will invoke the `Shlinkio\Shlink\Importer\ImportedLinksProcessorInterface` service.

Requirements
------------

[](#requirements)

This package expects some services to be registered as dependencies, as they need to be used by some provided tools.

- `Shlinkio\Shlink\Importer\ImportedLinksProcessorInterface`: It has to resolve an object implementing the interface.
- `Psr\Http\Client\ClientInterface`: Required to be able to import from Bit.ly, YOURLS, Kutt.it or another Shlink instance.
- `Psr\Http\Message\RequestFactoryInterface`: Required to be able to import from Bit.ly, YOURLS, Kutt.it or another Shlink instance.

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance89

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Recently: every ~149 days

Total

24

Last Release

23d ago

Major Versions

v1.0.1 → v2.0.02020-10-24

v2.5.0 → v3.0.02022-04-23

v3.0.0 → v4.0.02022-08-06

v4.0.0 → v5.0.02022-12-16

PHP version history (7 changes)v1.0.0PHP ^7.4

v2.1.0PHP ^7.4 || ^8.0

v2.4.0PHP ^8.0

v4.0.0PHP ^8.1

v5.2.0PHP ^8.2

v5.6.0PHP ^8.3

v5.7.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/73480af83259e096d154a8c4333e550c186b28ccb7a0d11f537b9aa57ad35392?d=identicon)[acelaya](/maintainers/acelaya)

---

Top Contributors

[![acelaya](https://avatars.githubusercontent.com/u/2719332?v=4)](https://github.com/acelaya "acelaya (255 commits)")

---

Tags

hacktoberfest

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/shlinkio-shlink-importer/health.svg)

```
[![Health](https://phpackages.com/badges/shlinkio-shlink-importer/health.svg)](https://phpackages.com/packages/shlinkio-shlink-importer)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k5.2k](/packages/shlinkio-shlink)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
