Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 3 commits ahead, 6 commits behind timcrockford:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

YOURLS API plugin: action=lookup-url-substr

This YOURLS plugin adds new command to the YOURLS API: action=lookup-url-substr — searches all keywords in the database which resolve to long URLs containing specified substring. API call requires substr parameter. Literally LIKE %substr% SQL expression is used for entries filtering.

The plugin is useful when searching for URLs disregarding GET parameters: for example, search URL with any UTM tags combination.


Assume your database contains the following entries:

keyword url comment
kw1 https, subdomain and parameter 1
kw2 subdomain only
kw3 https, subdomain and parameter 2
kw4 http and parameter 2
kw5 http, parameters 1 and 2

The following API calls will respond with the corresponding keywords field values:

  • action=lookup-url-substr& => ["kw1","kw2","kw3"]
  • action=lookup-url-substr& => ["kw1","kw2","kw3","kw4","kw5"]
  • action=lookup-url-substr&substr= => ["kw1","kw3"]
  • action=lookup-url-substr& => ["kw3","kw4"]

How to install this plugin

  1. Copy plugin files to $YOURLS_ABSPATH/user/plugins:
    1. cd into directory defined via $YOURLS_ABSPATH configuration parameter of your YOURLS installation.
    2. cd user/plugins
    3. Copy files:
      1. Either clone via git: git clone This will create a copy of this repository in the $YOURLS_ABSPATH/user/plugins/yourls-api-lookup-keywords-by-url-substr directory.
      2. Or just manually create a directory mkdir yourls-api-lookup-keywords-by-url-substr and copy plugin.php file into it.
    4. Name of the plugin directory is arbitrary: all the info is stored in the comment block of plugin.php file.
  2. Open plugins manager of your YOURLS: https://$YOURLS_SITE/admin/plugins.php.
  3. Activate plugin.


A plugin for YOURLS designed to lookup all keywords which resolve to URLs containing specified substring.







  • PHP 100.0%