diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py
index c1f46472..ed9a09df 100644
--- a/cli/koji_cli/commands.py
+++ b/cli/koji_cli/commands.py
@@ -2346,10 +2346,7 @@ def anon_handle_list_api(goptions, session, args):
if len(args) != 0:
parser.error(_("This command takes no arguments"))
activate_session(session, goptions)
- tmplist = [(x['name'], x) for x in session._listapi()]
- tmplist.sort()
- funcs = [x[1] for x in tmplist]
- for x in funcs:
+ for x in sorted(session._listapi(), key=lambda x: x['name']):
if 'argdesc' in x:
args = x['argdesc']
elif x['args']:
diff --git a/www/kojiweb/api.chtml b/www/kojiweb/api.chtml
new file mode 100644
index 00000000..291d5840
--- /dev/null
+++ b/www/kojiweb/api.chtml
@@ -0,0 +1,15 @@
+#include "includes/header.chtml"
+
+
API reference
+
+
+
+#include "includes/footer.chtml"
diff --git a/www/kojiweb/includes/header.chtml b/www/kojiweb/includes/header.chtml
index d008f4e3..421b3f13 100644
--- a/www/kojiweb/includes/header.chtml
+++ b/www/kojiweb/includes/header.chtml
@@ -74,6 +74,7 @@ $localnav
Hosts
Reports
Search
+ API
diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py
index b5880b61..b5ecd78c 100644
--- a/www/kojiweb/index.py
+++ b/www/kojiweb/index.py
@@ -2344,6 +2344,16 @@ def search(environ, start=None, order=None):
else:
return _genHTML(environ, 'search.chtml')
+
+def api(environ):
+ values = _initValues(environ, 'API', 'api')
+ server = _getServer(environ)
+
+ values['methods'] = sorted(server._listapi(), key=lambda x: x['name'])
+
+ return _genHTML(environ, 'api.chtml')
+
+
def watchlogs(environ, taskID):
values = _initValues(environ)
if isinstance(taskID, list):
diff --git a/www/static/koji.css b/www/static/koji.css
index 2f311389..aa0b912e 100644
--- a/www/static/koji.css
+++ b/www/static/koji.css
@@ -146,7 +146,8 @@ body#users #mainNav li#usersTab a,
body#hosts #mainNav li#hostsTab a,
body#buildtargets #mainNav li#buildtargetsTab a,
body#reports #mainNav li#reportsTab a,
-body#search #mainNav li#searchTab a {
+body#search #mainNav li#searchTab a,
+body#api #mainNav li#apiTab a {
background-color: #eee;
color: #000;
}