HTTP API

This highlighter can be used as an HTTP service by sending a POST or GET request to this URL, with any of the parameters listed below either embedded in the URL, or in an application/x-www-form-urlencoded request body. The response body will contain the highlighted code in case of a successful request, or an error message when returning an error HTTP status code.

language
One item from this programming language list: ActionScript, Active4D, Active4D Config, Active4D Library, Ada, Ant, ANTLR, Apache, AppleScript, ASP, ASP vb.NET, Bash, BibTeX, Bison, Blog — HTML, Blog — Markdown, Blog — Text, Blog — Textile, Bulletin Board, C, C++, C++ Qt, camlp4, CMake Listfile, ColdFusion, Context Free, CSS, CSV, D, DokuWiki, Doxygen, Dylan, Eiffel, Erlang, F-Script, Fortran - Modern, Fortran - Punchcard, FXScript, Gettext, Grails Server Page, Graphviz (DOT), Greasemonkey, Gri, Groovy, GTD, GTDalt, Haskell, HTML, HTML (Active4D), HTML (ASP), HTML (ASP.net), HTML (Django), HTML (Erlang), HTML (Mason), HTML (Rails), HTML (Tcl), HTML (Template Toolkit), iCalendar, Inform, Ini, Installer Distribution Script, Io, Java, JavaDoc, Java Properties, JavaScript, JavaScript (Rails), JavaScript jQuery, JavaScript Prototype & Script.aculo.us, Javascript YUI, Java Server Page (JSP), JSFL, JSON, JUnit Test Report, Language Grammar, LaTeX, LaTeX Beamer, LaTeX Log, LaTeX Memoir, LaTeX Rdaemon, Lex/Flex, Lid File, Lighttpd, LilyPond, Lisp, Literate Haskell, Logo, Logtalk, Lua, MacPorts Portfile, Mail, Makefile, Makegen, Man, Markdown, MATLAB, Maven POM, Mediawiki, MEL, MIPS Assembler, Modula-3, mod_perl, MoinMoin, MooTools, Movable Type, Movable Type (MT only), MultiMarkdown, Objective-C, Objective-C++, Objective-J, OCaml, OCamllex, OCamlyacc, Octave, OpenGL, Pascal, Perl, Perl HTML-Template, PHP, Plain Text, PmWiki, Postscript, Processing, Prolog, Property List, Prototype & Script.aculo.us (JavaScript) Bracketed, Python, Python Django, qmake Project file, Quake Style .cfg, R, Ragel, R Console (R.app), R Console (Rdaemon), R Console (Rdaemon) Plain, Rd (R Documentation), Regular Expressions (Oniguruma), Regular Expressions (Python), Release Notes, Remind, reStructuredText, Rez, RJS, Ruby, Ruby Haml, Ruby on Rails, S5 Slide Show, Scala, Scheme, Scilab, Setext, Slate, Smarty, SQL, SQL (Rails), SSH Config, Standard ML, Standard ML - CM, Strings File, Subversion commit message, SWeave, SWIG, Tcl, TeX, TeX Math, Textile, Thrift, TSV, Twiki, Txt2tags, Vectorscript, XML, XML strict, XSL, YAML
theme
One item from this theme list: Active4D, All Hallow's Eve, Amy, Blackboard, Cobalt, Dawn, Eiffel, Espresso Libre, IDLE, LAZY, Mac Classic, MagicWB (Amiga), Pastels on Dark, Slush & Poppies, Solarized (dark), Solarized (light), SpaceCadet, Sunburst, Twilight, Zenburnesque, iPlastic.
code
Your source code.

Example for the Sunburst theme:

<?php
$example = 'echo \'Hello World\';';
$c = curl_init('http://markup.su/api/highlighter');
curl_setopt_array($c, array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => 'language=PHP&theme=Sunburst&source=' . urlencode($example)
));
$response = curl_exec($c);
$info = curl_getinfo($c);
curl_close($c);

if ($info['http_code'] == 200 && $info['content_type'] == 'text/html') {
    echo $response;
} else {
    echo 'Error';
}
?>

Developed by lusever.