An Introduction to Freebase Application Development
You're a web developer, you've seen some cool apps that use Freebase but you can do better ... where do you start?
Get friendly with the apps page
The apps page is the central resource for developers. Here you'll find links to documentation, discussions, sample applications, and more.
Learn MQL
To access Freebase you need to learn MQL , the Metaweb Query Language. It's documented in the Query API reference.
You can experiment with MQL, and see some simple examples, in the Query Editor .
If you view any of our Freebase queries , there's also an option on the left hand side to show the original MQL.There's also Query Builder - a visual query builder, fantastic if you don't dream in MQL.
You may also find it useful to use the dev toolbar while working on MQL queries. On any topic page you can show the dev toolbar by pressing F8 and scrolling down. This lets you access the explore view ( example ) which shows all the data on a topic. (Compare to normal view) Don't waste time writing MQL queries for data that doesn't exist.
Develop apps in Javascript
Javascript is currently our best supported development language, though you can also write Freebase apps in any other language which can make HTTP requests (i.e. just about all of them.)
Since Freebase provides a JSON api it's easy to write complete applications that run entirely inside a web browser, no server-side programming required.
- Sample apps. Here's the current list of Freebase apps written in Javascript: (TODO: create when filter view is finished) Featured , Listed , All .
- Hello World. This List of Countries is generated with only a few lines of Javascript. You might want to read about mqlread in the API docs.
Be more productive with Mjt
You can increase your productivity by using mjt , Metaweb's Javascript templating tool.
The mjt intro tour is a great way to learn about mjt. This O’Reilly shortcut about mjt and this one about mjt apps are definitely worth reading.
Tips:
- Link to mjt.js on mjtemplate.org for improved cache performance.
- You might need your own server side code to store private data. All data on Freebase is public and should (in theory) be interesting to at least some percentage of the planet.
- To preserve your sanity when debugging we recommend Firefox + Firebug and a text editor that can validate XHTML.
Develop apps in Python
Most of the examples in our API manual are written in Python. A Python library is also available on Google Code: freebase-python .
Publicise your application
Once your app is created, tell the world about it!
- Create a new topic for it of type Freebase Application (or Metaweb Framework if you're working on a framework, library, module, etc.)
- When your app or framework is ready for public consumption co-type it Freebase Listing and fill in the newly created properties.
- Make sure you attribute Freebase as your data-source with a link to Freebase.com
- Tell the world, well at least the developers mailing list if you'd like feedback. You could also apply for a job ;-)
For further info, tips and help:
- Freebase Developers Blog - the official blog
- Developers Mailing List - for quick and helpful answers. This is archived and can be searched on freebase.markmail.org
- IRC: #freebase on irc.freenode.org

