Surveymoji

API

Surveymoji offers a simple REST API for access to rating data.

Rate Limiting

There is no rate limiting in effect currently, but it may be added at a future time.

Authentication

The REST API requires no authentication at this time.

Data Requests

The request format for data is simple:

GET https://surveymoji.com/api/data/url={URL}

The response will contain the following data:

Item

Description

result

The result of the request, which will be “ok” if the request was valid and data is available for the URL provided, or “error” if the request resulted in an error. An “error” response will include a details value providing more information about the error.

total

The total number of ratings for the URL.

average

The average of all ratings for the URL.

ratings

An array of individual rating counts (on the 5 to 1 scale) for the URL.

last_rating

An array of two values referring to the time the most recent rating was submitted for the URL. timestamp consists of a date and time string in the format YYYY-MM-DD HH:MM:SS. relative consists of a string indicating the time the rating was received relative to the current time (e.g. “15 minutes ago”).

recent

An array of the five most recent ratings received, in descending order. The array contains the rating, when it was created (created_at, in the same timestamp and relative formats discussed above), information about the user’s system (including their operating_system, browser, and version), and information about the user’s location (including their country, region, city, longitude, and latitude). Note that location data is approximate and does not reveal the precise location of any user.

Sample Response

{
    "result": "ok",
    "total": 472,
    "average": "3.2013",
    "ratings": {
        "5": 52,
        "4": 59,
        "3": 317,
        "2": 20,
        "1": 24
    },
    "last_rating": {
        "timestamp": "2017-02-21 01:20:59",
        "relative": "2 hours ago"
    },
    "recent": [
        {
            "rating": 5,
            "created_at": {
                "timestamp": "2017-02-21 01:20:59",
                "relative": "2 hours ago"
            },
            "system": {
                "operating_system": "Macintosh",
                "browser_name": "Safari",
                "browser_version": "10.0.3"
            },
            "location": {
                "country": "United States",
                "region": "Kentucky",
                "city": "Louisville",
                "latitude": "38.2706",
                "longitude": "-85.6237"
            }
        },
        {
            "rating": 5,
            "created_at": {
                "timestamp": "2017-02-21 01:19:57",
                "relative": "2 hours ago"
            },
            "system": {
                "operating_system": "Macintosh",
                "browser_name": "Safari",
                "browser_version": "10.0.3"
            },
            "location": {
                "country": "United States",
                "region": "Kentucky",
                "city": "Louisville",
                "latitude": "38.2706",
                "longitude": "-85.6237"
            }
        },
        {
            "rating": 5,
            "created_at": {
                "timestamp": "2017-02-20 18:36:03",
                "relative": "9 hours ago"
            },
            "system": {
                "operating_system": "Macintosh",
                "browser_name": "Safari",
                "browser_version": "10.0.3"
            },
            "location": {
                "country": "United States",
                "region": "Kentucky",
                "city": "Louisville",
                "latitude": "38.2706",
                "longitude": "-85.6237"
            }
        },
        {
            "rating": 5,
            "created_at": {
                "timestamp": "2017-02-20 18:33:11",
                "relative": "9 hours ago"
            },
            "system": {
                "operating_system": "Macintosh",
                "browser_name": "Safari",
                "browser_version": "10.0.3"
            },
            "location": {
                "country": "United States",
                "region": "Kentucky",
                "city": "Louisville",
                "latitude": "38.2706",
                "longitude": "-85.6237"
            }
        },
        {
            "rating": 5,
            "created_at": {
                "timestamp": "2017-02-20 05:05:23",
                "relative": "22 hours ago"
            },
            "system": {
                "operating_system": "Macintosh",
                "browser_name": "Safari",
                "browser_version": "10.0.3"
            },
            "location": {
                "country": "United States",
                "region": "Kentucky",
                "city": "Louisville",
                "latitude": "38.2706",
                "longitude": "-85.6237"
            }
        }
    ]
}

Last modified on November 25, 2017