EmCheio.com API
There is an API available in order to use the EmCheio.com service in a programatic way.
Getting started
All of the API methods return a data structure serialized with JSON:
{"status": {"msg": "MSG", "code": CODE}, "data": {···}}
The Methods
/api/shorten?url=x&hide_url=x
This method is used to generate a code for a given URL.
The input:
- - url (string, required): the url to be shorten
- - hide_url (bool, optional. default 0): if this variable is set to 1, the url will be hidden from the browser's address bar
The output:
"data": { "url": "http://www.theveryoriginalurl.com", "short_url": "X9y", "code": "X9y"}
| CODE | MSG |
| 200 |
|
| 500 |
|
/api/expand?code=x
This method is used to fetch an URL by code.
The input:
- - code (string, required): search for an URL with this code
The output:
"data": { "url": "http://www.theveryoriginalurl.com", "short_url": "X9y", "code": "X9y"}
| CODE | MSG |
| 200 |
|
| 404 |
|
| 500 |
|
/api/requests?code=x
This method is used to retrieve the number of requests done to a specific URL (given a code).
The input:
- - code (string, required): search for an URL with this code
The output:
"data": {"code": "X9y", "requests": "3362"}
| CODE | MSG |
| 200 |
|
| 404 |
|
| 500 |
|