See for yourself how easy it is to use HTSQL with the MusicBrainz database
Search for your favorite artists, albums, and tracks. Just start typing in the Query box below, pick a database table, and go! Not sure what to search for? See our examples below.
| Query |
Share the Joy of HTSQL
Julia Ridgely

Offline
Date: Jan. 06, 2010
One of the novel features of HTSQL is the ability to incorporate queries—or their results—into a wide variety of web pages without coding. Because HTSQL is “regular old HTML (and HTTP),” anyone can copy or share queries and results without using server- or client-side scripts. This dramatically lowers the barrier for including dynamic database queries in web sites, blogs, chat sessions, SMS messages, and anywhere you might use URLs or HTML.
URLs Go Everywhere
Let’s start with the simplest example: sharing a query with a friend. He just texted you to let you know he’s at a vintage record store, and you’d like him to keep an eye out for the original release of Prince’s album 1999, which you’d like to add to your collection. While you have him on the phone, you enter a query to see all the releases of 1999 in the MusicBrainz database:
It’s a little long to type into an SMS message, so you email it to him instead. If your friend has access to a web browser on his cell phone, it’s a simple matter for him to view the results. The same is true on any platform that can let you enter a URL and view HTML.
URLs are highly portable, ubiquitous, and easy to use; HTSQL URLs provide access not just to static web pages but to dynamic, interactive data views. Of course, it’s easy to look up music information on your mobile phone. The real value of HTSQL lies in being able to share business or research data with colleagues and customers. With HTSQL, there are no spreadsheets to email, no portals to create accounts on, and no reports to wait for—just write your query and share it using the countless devices and social media that support URL sharing. Copy-and-paste your URL query or use the Digg, Twitter, or Facebook widgets on this page to give it a try.
A quick note about quotation marks: like a lot of punctuation, they aren’t officially supported as part of a URL query string. Most programs handle this by “URL encoding” them behind the scenes, substituting a % sign and a number that the browser can understand. Usually this works fine, even if it looks a little funny. URL encoding can turn this URL:
http://musicdemo.htsql.com/track{artist.name,name}?name='Tiny Bubbles'
into this:
http://musicdemo.htsql.com/track%7artist.name,name%7D?name=%27Tiny%20Bubbles%27
In rare cases, though, the program may substitute another character, such as a “back tick” for a single quote, resulting in an HTSQL error. In that case, just try retyping the URL so that this:
http://musicdemo.htsql.com/track{artist.name,name}?name=`Tiny Bubbles`
turns into this:
http://musicdemo.htsql.com/track{artist.name,name}?name='Tiny Bubbles'
Embedding Query Results
But what if you want to take it a step further and actually integrate the data with online content? Exporting data as HTML and dropping it into a web page can be a hassle, and it “freezes” the data at a point in time. By using the “Embeddable Code” feature on this page, you can embed a mini-page within your web page or blog. Just click the “Embed HTML” button and copy-and-paste the result into your page.
This method, which uses the HTML object tag, isn’t foolproof; some browsers and social media platforms don’t support it or will strip out the code. In that case, consult the nearest HTML guru or the website's FAQ for the best way to do it.
As with other URLs, HTSQL’s extended characters need to be handled carefully when using them in code, whether it’s HTML, JavaScript, or another language of your choice. An easy way to avoid problems is to “escape” the troublesome characters by putting a backslash (\) in front of them:
http://musicdemo.htsql.com/track{artist.name,name}?name=\'Tiny Bubbles\'
Building Your Own Application
Of course, the ultimate way to share data with HTSQL is to build your own application. Using the HTSQL's XML output capability may be the easiest way; there are dozens of programming environments, from Adobe Flash to Microsoft Silverlight to pretty much ever server-side scripting or development language, that can make quick work of XML.
To output the results of a query in XML, just add .xml after the selectors (curly braces) but before the filter (question mark):
http://musicdemo.htsql.com/track{artist.name,name}.xml?name='Tiny Bubbles'
This demo works best when using Firefox 3.x, Internet Explorer of version 6 and higher, Safari or Chrome. If you do not have one of these browsers, you may not be able to use all of its features. Close
Share This
Embeddable Code
'Tis the Season (for Cover Songs) All You Need is Love (and HTSQL)
Embeddable Code
| Width: | Height: |
Previous articles

