Movatterモバイル変換


[0]ホーム

URL:


Use theAnalytics Data API to programatically access and integrate Shareaholic report data

Build custom dashboards, automate reporting or integrate with other applications.

Analytics Data Feed API

API Designed for Ease

We have optimized for ease of implementation. Most implementations of this API take less than 15 minutes to setup. Simply call the provided URLs with their respective parameters, and you're done.

Getting Started: Authentication

All analytics data API endpoints requireSecret API token authentication credentials to be supplied. If you don't include your secret token when making an API request or use an incorrect or outdated one, you will get an error. To get your API Token, you need aShareaholic account and Site ID. Signup for an account andadd your site to get a Site ID.

Once you have your Site ID:

  1. Go toSettingsIntegrations
  2. Scroll down to theAPI Tokens section
  3. ClickCreate new token
We also offer the option to automatically export raw analytics event data to your Amazon AWS S3 Bucket for custom analysis every hour, day, etc. Setup under Site Profile → Integrations → Amazon AWS S3.

Keeping your Secret API tokens safe

You should treat your Secret API token as you would any other password. Publicly exposing your credentials can result in your account being compromised. Grant access only to those who need it. Ensure it is kept out of any version control system you may be using. Control access to your key using apassword manager orsecrets management service.

API Endpoints

1. Total share button clicks for each URL in a given timeframe

curl -XGET 'https://www.shareaholic.com/api/v3/analytics/share/pages.csv?site_id=:site_id&start=:interval_start&end=:interval_end' \-H 'Authorization: Bearer :secret_api_token'

ParameterDescriptionRequiredParameter TypeExample
site_idSite Profile IDRequiredQuerysite_id=8943b7fd64cd8b1770ff5affa9a9437b
startDate (and optional hour) of the start of the periodRequiredQuerystart=2021-10-01, start=2021-10-01T14
endDate (and optional hour) of the end of the periodrequiredQueryend=2021-10-01, end=2021-10-01T14
domainDomain or sub-domain to filter. Defaults to all domains i.e. no filter.OptionalQuerydomain=shareaholic.com
tzTime zone asIANA Time zone ID or ISO–8601 UTC offset (preferred). Defaults to UTC.OptionalQueryFormats supported:
tz=America/New_York (IANA Time zone ID)
tz=-04:00 (ISO–8601 UTC offset)
serviceService to get counts for. Defaults to all services.OptionalQueryservice=facebook

Example:

curl -XGET 'https://www.shareaholic.com/api/v3/analytics/share/pages.csv?site_id=pde830kcbe239e821h33381e9175062f&start=2021-10-01&end=2021-10-02' \-H 'Authorization: Bearer 12cad1l17b7f3b79d91a1e7593e5f9a1'

Result:

URL,sharesshareaholic.com/blog,123shareaholic.com,456

2. Share button clicks for a given URL in a given timeframe by service

curl -XGET 'https://www.shareaholic.com/api/v3/analytics/share/counts.csv?site_id=:site_id&start=:interval_start&end=:interval_end&url=shareaholic.com/blog' \-H 'Authorization: Bearer :secret_api_token'

ParameterDescriptionRequiredParameter TypeExample
site_idSite Profile IDRequiredQuerysite_id=8943b7fd64cd8b1770ff5affa9a9437b
startDate (and optional hour) of the start of the periodRequiredQuerystart=2021-10-01, start=2021-10-01T14
endDate (and optional hour) of the end of the periodrequiredQueryend=2021-10-01, end=2021-10-01T14
urlURL to get data for (protocol is optional)RequiredQueryurl=shareaholic.com/blog
tzTime zone asIANA Time zone ID or ISO–8601 UTC offset (preferred). Defaults to UTC.OptionalQueryFormats supported:
tz=America/New_York (IANA Time zone ID)
tz=-04:00 (ISO–8601 UTC offset)
serviceService to get counts for. Defaults to all services.OptionalQueryservice=facebook

Example:

curl -XGET 'https://www.shareaholic.com/api/v3/analytics/share/counts.csv?site_id=pde830kcbe239e821h33381e9175062f&start=2021-10-01&end=2021-10-02&url=shareaholic.com/blog' \-H 'Authorization: Bearer 12cad1l17b7f3b79d91a1e7593e5f9a1'

Result:

service_code,service_name,sharesfacebook,Facebook,3fark,Fark,1sms,SMS,2

3. List of possibleservice_code values

The web is dynamic. Services can be added and retired over time. This API makes it convenient to fetch the most up-to-date list of supported services and theirservice_codeservice_name map.

curl -XGET 'https://www.shareaholic.com/api/v3/services.json'

Result:

[ {    "service_id":5,    "service_code":"facebook",    "service_name":"Facebook" }, {    "service_id":7,    "service_code":"twitter",    "service_name":"Twitter" }, ...]

Error codes

HTTP ResponseError CodeDescription
40110Not authorized - No credentials provided
40311Forbidden - Provided credentials do not have permission
404100Missingsite_id
404101Invalidsite_id
400110Missing date
400111Invalid date provided
400112Date range should be 60 or fewer days
400140Missing or invalidURL

Branding Requirements

We require that you adhere to our branding requirements, as follows:

  • Any displayed metrics must cite "Shareaholic" as the source
  • Where possible, any displayed metrics must provide an active link to https://www.shareaholic.com
  • If data is used to create a graphical representation of the metrics, anapproved Shareaholic logo needs to be present within or adjacent to the graphic. It is up to the discretion of the publisher where to specifically place the logo within or adjacent to the graphic.

Feedback

If you believe you have found a bug, or you’d like to request additional functionality, or you release something using this API, we’d love tohear from you.

Build with Shareaholic

Developer Tools and APIs that are reliable, stable, and fast. Built and run on the same scaled cloud infrastructure that runs Shareaholic products and powers functionality across over 300,000+ sites. Over 10 rock solid years in production.

As seen in

[8]ページ先頭

©2009-2025 Movatter.jp