API URL: https://www.urlcompensator.com/compensate
It is possible to send JSON or form fields. (Content-Type header must be set properly)
Required fields
Field | Description |
---|---|
url | Must be valid url starting with http(s). |
length | Integer. How long the generated url should be. Maximum value 2000. |
You can get XML or JSON response by setting the Accept header accordingly
Accept: application/json
{ "url": "http://neti.ee", "length": "50", "generated": "https://www.urlcompensator.com/go/R0l2QWxXQXR2a0lQT3k3M1JLNTF3VjZ1bkBAQGh0dHA6Ly9uZXRpLmVlQEBAbG43RjMxcnVGTUh5TnZ2MHZmYl93NWRYbg==" }
[ { "field": "length", "message": "Length must be no less than 20." } ]
Accept: application/xml
<?xml version="1.0" encoding="UTF-8"?> <response> <url>http://neti.ee</url> <length>50</length> <generated>https://www.urlcompensator.com/go/dWZXbEw5V0dBb0R0WjBmR1lacEVXRU4wWkBAQGh0dHA6Ly9uZXRpLmVlQEBASHBmSGNwdnp6SnZEdkpUd0dKTFpFdDdSZw==</generated> </response>
<?xml version="1.0" encoding="UTF-8"?> <response> <item> <field>length</field> <message>Length must be no less than 20.</message> </item> <item> <field>url</field> <message>Url is not a valid URL.</message> </item> </response>
You throw your hard earned cash at meaningless fads every day. Why not use it on something even less significant!