# Using Share buttons
# About
You can easily create and add the Share button from LINE Social Plugins to the website of your choice. If you want to add this to iOS or Android native apps, we recommend that you use the "Share with" screen. For more information on how to add this screen, refer to the "Using LINE Features with the LINE URL Scheme" page.
There are two ways to create the Share button. You can either create a button using the default designs provided by LINE, or use your own design to create a custom icon.
# Using official LINE icons
Follow the steps below to create a Share button using the default designs provided by LINE. All you need to do is simply select a language, enter the URL of a webpage where you want to add the button, and select a design for the button.
1. Select a language Select the language of the website where you want to add a button. The button will be created in the selected language.
2. Set URL Enter the URL of the website that you want to add this button to. Note that this will also be the webpage that will be shared when a user uses the Share button.
3. Button type Select a design for the Share button.
4. Size
5. Share counter Choose whether you want to turn on the share counter and show the number of shares along with the Share button.
Now you can see the code generated by the options you have selected if you read and agree to the LINE Social Plugins usage guidelines below. When you add the generated code to the DOM of your website, the code will be called by the DOMContentLoaded event. Make sure to insert the code to the location where you want to display this button. However, if you paste the code more than once to add multiple buttons to a single page, make sure to include a script tag only for the last button.
# Using custom icons
You can see the link if you read and agree to the LINE Social Plugins usage guidelines below. You can create a Share button using your custom icon if you copy the link and apply it to your button.
Example (URL: https://line.me/en)
https://social-plugins.line.me/lineit/share?url=https%3A%2F%2Fline.me%2Fen
Once the DOM tree is constructed and content is produced on your site, call LineIt.loadButton()
to enable the Share button.
<script type="text/javascript">LineIt.loadButton();</script>
For custom icons, you can check the number of shares by following the steps below.
# HTTP request
GET https://api.line.me/social-plugin/metrics?url=https://line.me/en
# Request parameters
url
String
The URL to get the share count for.
(For example: https://line.me/en)
# Sample request
curl -X GET 'https://api.line.me/social-plugin/metrics?url=https://line.me/en'
# Sample response
{
"share": "4173",
}
# Status codes
200
OK
The request succeeded.
400
Bad request
The request contains invalid parameters or values.
500
Internal Server Error
An internal server error occurred.