link.fish API 2018-07-05
Added: 11/12/2017
Updated at: 10/08/2020
API to easily extract data from websites. # Base URL All URLs referenced in the documentation have the following base: ``` https://api.link.fish ``` The REST API is only served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported. # Authentication HTTP requests to the REST API are protected with [HTTP Basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). You will use the email address of your link.fish account as the username and your API access token as the password for HTTP Basic authentication. If you do not have an account yet, go to [https://link.fish/api](https://link.fish/api) and create one first. You will receive the API access token automatically via email after you signed up. To generate a new token and invalidate the current one log into your link.fish account at [https://app.link.fish](https://app.link.fish) and go to: "Plugins" -> "API Dashboard" There you can also see how many credits you used already. # Errors The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format: ``` { "status": {HTTP STATUS CODE} "message": "{ERROR MESSAGE}" } ``` Like for example when the authorization is not provided or wrong: ``` { "status": 401 "message": "Unauthorized" } ``` # Request IDs Each API request has an associated request identifier. You can find it in the response headers, under X-LF-Request-Id. In case you have problems please provide this identifier that we can help you as good and fast as possible. Example: ``` X-LF-Request-Id: f7f0036f-5277-421a-b143-f7a151571d18 ``` # Item format The data is by default deeply nested. So if it should be checked if there is an offer with a price, the whole tree has to be checked. To make that simpler, it is also possible to return the data "flat". If selected it will flatten the tree by copying all the data to the main level under a property with the name of its type and link the data internally. Information: We created a node module which allows converting between the two formats. It did not get open sourced yet. If you are in need, simply contact us via api@link.fish. # Response Content Type By default, all data gets returned as JSON. If the data should be returned as XML add the following header: ``` Accept: application/xml ``` # Credits Depending on the request made a different amount of credits get charged. How many which request costs can be found on the [API pricing page](http://link.fish/api/#pricing). Additionally, does a header named "X-LF-Credits-Charged" get added to each successful response with information about the credits. Example: ``` X-LF-Credits-Charged: 1 # Credits used for current requests X-LF-Credits-Subscription-Max: 1000 # Total credits available in subscription X-LF-Credits-Subscription-Used: 512 # Credits still left in current month ``` You can check anytime how many credits you did use already by logging into your link.fish account at [https://app.link.fish](https://app.link.fish) and checking under: "Plugins" -> "API Dashboard" If you have problems, questions or improvement advice please send us an email to api@link.fish