API

HTTP API

Depracation Notice: As of December 1, 2013, the HTTP API is no longer available. Please stay tuned for further announcements. We regret the inconvenience caused.

LinkBunch offers a simple, HTTP query string-based "API". You need to make the HTTP GET request to the following URL:

http://linkbun.ch/linkbunch.php

... and pass the following parameters to it:

links = http://link1%0D%0Ahttp://link2%0D%0Ahttp://link3%0D%0A...
bunch = Bunch
mode = api

The links field needs to be URL encoded (space converted to %20, etc.) before it's passed on, or it won't work right. Separate multiple URLs by using the newline delimiter, i.e. %0D%0A, but this should automatically happen if you use a standard URL encoding function such as PHP's urlencode() over a multi-line text field.

Response

When mode=api is specified, this request will give you a response which only has the bunch url, i.e....

http://linkbun.ch/aa1

If you don't mention mode=api, you will be returned the actual HTML that you see when you manually use LinkBunch.

Error Handling

If there are any errors during the LinkBunching process, the API mode will simply return the plain text message:

ERROR

No codes, no other text.

Bug Reports and Suggestions

If you have trouble getting this to work, post your question(s) in Satisfaction, or email me or just Twitter.