9m icon indicating copy to clipboard operation
9m copied to clipboard

Public API for 9m?

Open ghost opened this issue 11 years ago • 3 comments

Is there an API available to shorten URL's?

ghost avatar May 27 '14 14:05 ghost

Hi, No there isn't – but there probably should be! If you want to generate URLs, you could POST to /create and read the Location header for now:

$ curl -i --data-urlencode "url=https://en.wikipedia.org/wiki/🍔" http://9m.no/create
HTTP/1.1 302 Found
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 28 May 2014 06:21:01 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: /show/滥㚈

(Note that the /create endpoint is rate-limited with a limit of 10 requests per minute with a burst of 3 requests.)

I'll keep this issue open, though, as it would be nice to have a proper, versioned API.

ehamberg avatar May 28 '14 06:05 ehamberg

(Huh, github destroyed my unicode character after I posted. The wikipedia link should end with the character 🍔 U+1F354 HAMBURGER.)

Edit: It showed up after a refresh. (Note that Chrome does not support emojis yet for some reason)

ehamberg avatar May 28 '14 06:05 ehamberg

Thanks :smile:

ghost avatar May 28 '14 06:05 ghost