Share Link API


Overview

The Share Link API is a read-only JSON API that allows retrieval of your Share Link data for use on your website or application where widgets are not feasible or practical.

{warning} There are strict retrieval limits on the use of the Share Link API and you must implement your own caching from the data you retrieve via the API, requesting new data no more than every 20 minutes. ie. You should not be retrieving from the API for each page view. Failure to adhere to this will result in API access being revoked.

API endpoints are created in the same way as widgets via the create widget page and selecting any widget labelled "API". You can customise the data the API endpoint will provide and see a preview of the (demo) data.

Once you have created and saved an API widget you can access the end point as below.

Retrieving API endpoints

Select the widget you have created from the main menu and click the "Embed" tab from the preview page. This will show you the different options for placing the widget in your site.

embed-demo-widget

As we will not be embedding the widget into a website you do not need all the embed code, just the URL of the widget. This can be found towards the end of the second line of code (that starts with <iframe>). Copy everything after src=" until the closing ".

For example:

<iframe width="100%" frameborder="0" loading="lazy" class="sharelink" scrolling="no" style="width: 1px;min-width: 100%;" src="https://app.sharelinktechnologies.com/widget/df3050ef-05fb-456c-8fe3-6bbe6f96f46c"></iframe>

Gives you the URL endpoint of:

https://app.sharelinktechnologies.com/widget/df3050ef-05fb-456c-8fe3-6bbe6f96f46c

You can now make GET requests to this URL to retrieve the JSON data.

{primary} Share Link data is locked to your domain. You will still need to make the GET request from your licensed domain and ensure that a request header is being sent containing this domain.

See a full PHP example.

Share Prices

Share prices are retrieved using the Share Price API widget. The data that comes back is a JSON encoded object with property key of the ASX code(s) associated with your plan followed by the data associated to that code.

In the example below we have 2 ASX codes, WES and IDX.

{"WES":{"open":53.84,"high":53.85,"low":53.48,"close":53.69,"volume":297198,"previousClose":53.87,"market_time":"2022-02-15 00:00:04","change":"-0.1800","market":"ASX","data_retrieved":1,"suspended":0,"name":"WESFARMERS LIMITED","currency":"AUD","symbol":"$"},"IDX":{"open":3.98,"high":3.99,"low":3.94,"close":3.95,"volume":102446,"previousClose":3.9699999999999998,"market_time":"2022-04-05 08:50:03","change":"-0.0200","market":"ASX","data_retrieved":1,"suspended":0,"name":"INTEGRAL DIAGNOSTICS LIMITED","currency":"AUD","symbol":"$"}}

Best practices

Cache data

You should not be retrieving data from the Share Link API for every page view, infact doing so may result in your Share Link data becoming unavailable due to request limits. Instead download the data once every 20 minutes (this is the update time for Share Link data anyway, so checking it anymore gives no advantage).

Limit quantity of data retrieved

When retrieving large amounts of data from the Share Link API consider if it will change and what can be cached to reduce the amount of data you need to retrieve upon each request.

As API endpoints are still basically widgets you can customise the data that is retrieved the same way you can any other widget.

For example, if you require an API end point to retrieve your ASX Announcements you should:

1) Create an ASX Announcements API widget with a limit and offset query parameter to get the optimal number of ASX Announcements. The limit is the maximum number of records to return for this query and offset is the number of records to skip.

2) Call this end point once and save the resulting announcements to a data store (usually your website's database)

3) Make get requests every 20-30 minutes on the same endpoint and update the database when new announcements are imported