StatsFC

Results

Here you'll find sample code and an example of our Results widget. The widget comes with it's own CSS, and is fully customisable.

This widget is also available as a WordPress plugin: StatsFC Results.

Full Code Example

<html>
<head>
    <title>Your Website Title</title>
</head>
<body>

    <!-- Load jQuery -->
    <script src="//code.jquery.com/jquery-2.1.4.min.js"></script>

    <!-- Load Stats FC Results SDK -->
    <script>
        (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = 'https://statsfc-4f51.kxcdn.com/widget/results-2.0.js';
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'statsfc-results-js'));
    </script>

    <!-- Your results here -->
    <div class="statsfc-results"
        data-key="YOUR STATSFC KEY"
        data-competition="EPL"
        data-show-badges="true"
        data-use-default-css="true">
    </div>

</body>
</html>

Settings

Setting HTML5 Attribute Description Default
key data-key Required. Your Stats FC account key. None
competition data-competition Required*. The key of the competition you want to show the results for.
None
team data-team Required*. The name of the team you want to show the results for.
E.g., Manchester City, Liverpool
None
highlight data-highlight Optional. The name of the team you want to highlight.
E.g., Manchester City, Liverpool
None
season data-season Optional. The season you want to show the results for.
E.g., 2016/2017
None
from data-from Optional. The date to get results from.
E.g., 2017-10-20, today
None
to data-to Optional. The date to get results to.
E.g., 2017-11-03, +2 weeks, next Monday
None
limit data-limit Optional. The maximum number of results to return.
E.g., 1, 4, 10
None
goals data-goals Optional. Whether or not you want to show goal scorers.
Can be one of: true, false
false
showBadges data-show-badges Optional. Whether or not you want to display team badges.
Can be one of: true, false
false
order data-order Optional. Whether to order results ascending of descending.
Can be one of: asc, desc
desc
timezone data-timezone Optional. The timezone you want to convert the match time to.
Europe/London
omitErrors data-omit-errors Optional. Whether or not you want to omit error messages.
Can be one of: true, false
false
useDefaultCss data-use-default-css Optional. Whether or not you want to use the widget's default styles.
Can be one of: true, false
false
lang data-lang Optional. The ISO 639-1 two-letter language code.
en

Notes

*At least one of competition or team is required.

If no from, to, limit, team or season parameters are provided, from will default to the start of the current matchweek. Otherwise, if no from or season parameters are provided, from will default to the start of the season for the provided competition or team.

Code Generator

Field Value

Credits

If you'd like to help us with any translations please get in touch at hello@statsfc.com or on Twitter @StatsFC.