Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a simple Unity lense for my college site which is based on Drupal, but I don't know how to adapt this command for Drupal API. Please help, it's python.

We now create our query url, using the Wikipedia opensearch API url = ("%s/w/api.php?action=opensearch&limit=25&format=json&search=%s" % (, search))

I'm using template to write lense following Wikipedia example I don't know python but Im familiar with C. This Drupal API calling is the only problem I have to successfully develop a lense. Please help!

share|improve this question
Does Drupal even have a search API you can call? – mhall119 Jun 7 '12 at 12:26

Drupal does not have a built-in facility for returning search results as JSON. You could use the contributed services_search module, which exposes a URL on your site such as

If you don't want to add the Services module to your site for some reason, you could write a custom module that uses the Drupal function search_data() to retrieve search results and then outputs them as JSON.

(Either way, you'll have to add something to your Drupal site, which makes this not an Ubuntu-specific question, so it should probably be moved to the Drupal SE site.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.