THIS IS A DRAFT
We would like to introduce a new feature for Wikidot users: Wikidot API.
Basic concept
Wikidot API is a way computer programs and automated system can access and interact with Wikidot for some user. Users must "authorize" applications to use their identity by supplying them their unique key Wikidot generates for them.
Technical details
Wikidot API is technically an XML-RPC service, with endpoint being this URL:
https://www.wikidot.com/xml-rpc-api.php
You must use HTTP Basic Authorization with the following credentials:
- user: the name of application that connects to API
- password: the unique key of user
API key
Users that want to test API, need to have their unique key generated by Wikidot. If you want to have one, comment on this page and ask for one!
On using XML-RPC service
To use XML-RPC service, you need to have XML-RPC client that is usually a library for a programming language.
We will now show how to use Wikidot API with Python (installing Python is out of scope of this document).
Run Python interactive console:
$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
You need to import the XML-RPC library for Python (in most cases it is already installed with the default installation of Python):
>>> from xmlrpclib import ServerProxy
Supply the URL, user (application name) and password (your API key) and construct a server object proxy and list all methods, that API provides:
>>> s = ServerProxy('https://your-app:your-key@www.wikidot.com/xml-rpc-api.php') >>> s.system.listMethods()
You should get a list like this:
['system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall', 'site.pages', 'site.categories', 'page.get', 'page.files', 'page.save', 'user.valid', 'user.sites']
If you get an exception instead:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
verbose=self.__verbose
File "/usr/lib/python2.5/xmlrpclib.py", line 1191, in request
headers
xmlrpclib.ProtocolError: <ProtocolError: 401 Unauthorized>
… this means, that probably you supplied wrong API key.
Explore the API methods
The full method list is located in a separate document.
Each method gets a dictionary (associative array) as an only parameter. To use site.pages, just issue:
>>> s.site.pages({'site': 'my-wiki'})
{'site': 'my-wiki'} is a dictionary with one item labeled site with value "my-wiki". In Wikidot API passing this dictionary to method site.pages means that you want to get pages of wiki my-wiki.
To get only pages in category system, issue:
>>> s.site.pages({'site': 'my-wiki', 'category': 'system'})
The order of keys in array is irrelevant.
If you are an administrator of this site, you'll get the list of pages.
Each item in the resulting list is a dictionary (associative array) of different properties of pages. This is another convention. Each return value in Wikidot XML-RPC API is a dictionary or list of dictionaries. Keys should be self-explanatory.
An example result of the previous command:
>>> s.site.pages({'site': 'my-wiki', 'category': 'system'}) [{'category': 'system', 'date_created': '2009-01-12T23:12:13+00:00', 'date_edited': '2009-01-12T23:12:13+00:00', 'full_name': 'system:join', 'name': 'join', 'parent_page': None, 'site': 'my-site', 'tag_array': ['some-tag', 'other-tag'], 'tag_string': 'some-tag other-tag', 'title': 'How to join?', 'title_or_unix_name': 'How to join?', 'title_shown': 'How to join?', 'user_created': 'Some user', 'user_edited': None}, {'category': 'system', 'date_created': '2009-01-12T23:12:13+00:00', 'date_edited': '2009-01-12T23:12:13+00:00', 'full_name': 'system:members', 'name': 'members', 'parent_page': None, 'site': 'my-site', 'tag_array': [], 'tag_string': '', 'title': 'Members', 'title_or_unix_name': 'Members', 'title_shown': 'Members', 'user_created': 'Some user', 'user_edited': None}]
For example, you can save the list to a variable and use a loop, to print a title and tags of each page:
>>> pages = s.site.pages({'site': 'my-wiki'}) >>> for page in pages: >>> print page['title'], page['tag_string']
As you see, we supply various formats for field tag. Also there are as much as three different title fields:
- title: the title set by user
- title_or_unix_name: the title if not empty, the unix name otherwise
- title_shown: the title shown. This includes autonumbering pattern
At most cases these three will be the same unless the title is empty or the autonumbering of pages is enabled.
Using languages other than Python
To use the API in Ruby you need to set a configuration option on XML-RPC library to let it support the <nil/> value, that we use (that is an extension of XML-RPC).
Comments
To apply for testing, please comment!






Hi Piotr,
my python is running …
Can you send me my own unique API Key ?
( PM ?)
Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)
Wollen Sie Wikidot helfen im deutschen » Handbuch ?
I have it running - now I can explore all the methods and functions..
Thanks again!
PS: the example loop printing titles shows me "every second" a page title of my wiki…. :)
PPS: to explain for other user: where I was stopped for a while - is the name giving process for the "user API":
I used "s = ServerProxy('https://helmuti_pdorf:3462.....(my long key).762..@www.wikidot.com/xml-rpc-api.php')
Not sure - but I think - I have to ,make a "unique name" inside wikidot "xml.rpc-api" . if this is not neccessary - than it does not disturb
Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)
Wollen Sie Wikidot helfen im deutschen » Handbuch ?
> Users that want to test API, need to have their unique key generated by Wikidot
> If you want to have one, comment on this page and ask for one!
Please send me my unique key — thanks!
Please send me a key too. I'd like to take a crack at this.
Thanks,
Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
Yes please!
λ James Kanjo | blog | photos | contact
I'm having good luck accessing the API with Python v2.6.1 for Windows and Mark Hammond's Python Extensions for Windows.
I installed version 2.6.1 (http://www.python.org/download/) for this reason:
Mark Hammond's Extensions are available here: http://sourceforge.net/project/platformdownload.php?group_id=78018
Any news on when we might see a working system.methodHelp or other documentation? The examples help, but it's kind of hard to figure things out with limited documentation.
Thanks,
-Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
We figured out, that what we came across is not a Zend Framework bug, rather a PHP one (we tested on 64 bit Ubuntu, and it worked well). We're not going to fix this, but instead provide better online documentation of methods.
Piotr Gabryjeluk
visit my blog
I'd like to try this!
As I try to get my feet wet in Python scripting, I have a test script you can tweak to help you get started too. I just took the samples Gabrys provided and modified them until I got some results back with my sites. I'm really looking forward to seeing some working examples from others, especially once we get write access and can really start breaking things! ;)
Unless we have a better place, I think I'll add a section on my site so we can share some code and discuss the API.
-Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
Thank you Ed!
Piotr Gabryjeluk
visit my blog
When we get write access to our sites via the API, will we be able to manipulate some or all of the database fields that we can read? This wish got me thinking that the API could help solve this issue.
I'd like to be able to clone a site and then go back and edit the creation date (especially blog entries so they display correctly with PageCalendar).
-Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
Hi Piotr,
Me too please
Paul
Please send me my unique key. I would like to test this API.
Thanks in advance,
Ajay
Would love one -thanks
martin_c…
While playing around with the new API, I found the following issues and questions:
I'd very much like ot get an API key
—peter keane
ude.saxetu.liam|enaekp#ude.saxetu.liam|enaekp
I would like to get a key.
I also want an API key.
I've started Wiki xml-api to bring together information about the API, Python, code snippets, and scripts as a platform to share information. You're welcome to join.
http://piotr.gabryjeluk.pl/dev:api-save - have a look on the page.save method Piotr describes in his blog!
Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)
Wollen Sie Wikidot helfen im deutschen » Handbuch ?
Thanks Ed! I would like to make it clear, the Python is only one of possible languages to write applications using the API. In practice any programming language is good, as long as it has good XML-RPC library.
Piotr Gabryjeluk
visit my blog
I'd like a key too :-)
Can I please have the key?
First Wikidot Wiki with a Chinese Domain! -> http://曾勁驊.info.tm/ or http://kenneth.wikidot.com
Out of your site limit? I've got 996 sites left. Ask me and I'll create one for you! Just PM me and let me know.^
^If you require an Iron Giant Template cloned site, please tell me that too!
Hi, I would like to test wikidot API. Could you send me an API key?
Only a question: has the API the functionality to create new pages in the wiki?
I have an old wiki in wikimedia format, and Id like to, once translated to wikidot format, to add these pages with a batch process.
Thanks in advance
temariotic: API access is now read-only, but we work on create/edit page functionality as well.
Piotr Gabryjeluk
visit my blog
Oooh…page creation would be a huge boon. I am using wikidot for review of ~80 conference abstracts which arrive (right now) via e-mail and need to be transferred to pages manually. Would love to be able to write a script for this.
@Derick: right this is one of so many use cases, we work on it!
Piotr Gabryjeluk
visit my blog
Any idea about the release date of this wonderful functionality?
Thanks for the reply.
I would love one of those keys too please.
"But sanctify the Lord God in your hearts, and always be ready to give a defense to everyone who asks you a reason for the hope that is in you, with meekness and fear;" ~ 1 Peter 3:16
@locapo: We're not able to talk release dates at this time, unfortunately. There are several pressing issues we are trying to get out the door, and once we deal with these we can spend more time on perfecting the Wikidot API. While there is no release date set as of this posting, I do know it is something we are currently discussing. It won't be too long now, thanks for being so patient!!
@everyone else who wants a key: If you have not yet received yours, please contact me!!
Thanks!
Rainey
Wikidot Support
Hi, could you please give a developer key?
Thanks a lot!
I'd like to have a key too.
I have just joined and the whole thing has me confused! I just want to play Trivia and to chat is that possible and how do I go about it?
Wrong forum ???
— Shane | CycloDS Revolution & Compatibility | Starting a community project? | Life's Handbook | XBL: leiger40
This looks cool. Please send me a key so I can try it.
but i suggest you give keys automatically so you don't have to send all.
Thanks.
Send me a key, pls.
Could I please have the developer Key !!
Many thanks in advance
These are get APIs are there any set APIs or any way to modify the page content through the apis ?
@uttaran dutta: No, there's no put/post API. Maybe in some time.
Piotr Gabryjeluk
visit my blog
That was the thing missing to wikidot.
I'm in hurry to try it, if you don't mind providing me with the suitable key ^^
Cheers
May I have an API key for the ASH wiki?
Hi, please can i have an API key?
Hello! Can I have a key, please? Thank you.
Hi, may I have an API key please? Thank you.