Disc Golf Course Review APIs
Standard API Documentation

The default output is JSON (JavaScript Object Notation). For more details on JSON and to obtain parsers please reference www.json.org.

Common API Parameters

The following parameters must be included in all API requests:

Required

Name Data Type Description
key string The API Key that was provided when access to the DGCourseReview API was granted.
sig string Signature generated via your API Key, API Secret and API Request

To generate your request signature, you must create an MD5 hash as follows:
API_KEY+API_SECRET+REQUEST_MODE
example. md5(XXXXXXXXXXXXYYYYYYYYYYYYcrseinfo);

Optional

Name Data Type Description Potential Values
out string Enables response to be requested in different formats. If this parameter is not specified the default format of JSON will be used. "json" - JavaScript Object Notation.
"xml" - XML response.

API Methods

Get Course Information:

Retrieves information for a specific course based on the supplied ID.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "crseinfo"
id integer required The DGCourseReview course ID for the course you'd like to retrieve information for.

Sample Request:

Sample Response:



Get Course Hole Information:

Retrieves hole information for a specific course based on the supplied ID.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "holeinfo"
id integer required The DGCourseReview course ID for the course you'd like to retrieve hole information for.

Sample Request:

Sample Response:



Get Course Photo:

Retrieves information for a photo for a specific course based on the supplied ID.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "crsephto"
id integer required The DGCourseReview course ID for the course you'd like to retrieve information for.

Sample Request:

Sample Response:



Searching by Map Bounding Box:

Allows the retrieval of course information based on the bounding box of a particular map. A request can be sent to the DGCourseReview API using the "top-right latitude and longitude" and "bottom-left latitude and longitude" for a geographical bounding box.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "near_box"
limit integer optional Specifies the number of courses to return in the result set. Default is 10. Minimum value is 1 and maximum value is 25
tr_lat double required Top right latitude of bounding box
tr_lon double required Top right longitude of bounding box
bl_lat double required Bottom left latitude of bounding box
bl_lon double required Bottom left longitude of bounding box

Sample Request:

Sample Response:



Searching by Geo-Point and Radius:

Enables searching for course information within a certain radius of a particular location.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "near_rad"
limit integer optional Specifies the number of courses to return in the result set. Default is 10. Minimum value is 1 and maximum value is 25
lat double required Latitude of geo-point to search near.
lon double required Longitude of geo-point to search near.
rad integer optional Radius to use while searching around specified geo-point. Maximum value = 25. Default value = 10.

Sample Request:

Sample Response:



Find Courses by Name:

Retrieves information on courses that fit the search criteria.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "findname"
name string required The course name to search for.

Sample Request:

Sample Response:



Find Courses by Location:

Retrieves information on courses that fit the search criteria.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "findloc"
city string required The city/town name to search for
state string required The state to search within. Only required if searching for courses within the US or Canada. Only standard two letter state/province abbreviations are accepted.
country string required The country to search within. Only standard two letter country abbreviations are accepted.

Sample Request:

Sample Response:



Find Courses by US Zip Code:

Retrieves information on courses that fit the search criteria.

Input Parameters:

Name Data Type Required / Optional Description
mode string required Value must be "findzip"
limit integer optional Specifies the number of courses to return in the result set. Default is 10. Minimum value is 1 and maximum value is 25
rad integer optional Radius to use while searching around specified geo-point. Maximum value = 25. Default value = 10.
zip string required The US Zip code to use as a center point.

Sample Request:

Sample Response:



Submit a Score:

Submits a round to a user's DGCR Scorebook. This request is submitted using POST to the following URL: https://www.dgcoursereview.com/api/

Input Parameters:

Name Data Type Required / Optional Description
key string required Your API key
sig string required Your generated API signature
mode string required Value must be "addround"
username string required The user's DGCR username.
password string required An MD5 hash of the user's DGCR password.
id integer optional The course id for the course where the round being submitted was played.
holes integer required The number of holes the user played
tee integer optional The tee played for the round being submitted. This will be either 1, 2, 3, or 4. Valid tee(s) can be retrieved using the Hole Information method.
date_played date required The date the round being submitted was played. Format is: YYYY-MM-DD
time_hour string optional The hour the round being submitted was played. Format is: hh
time_min string optional The minute the round being submitted was played. Format is: mm
time_ap string optional The time of day the round being submitted was played. Value is either: AM or PM
round_notes string optional Notes for the round being submitted. Generally entered by the user.
score base 64 encoded, serialized array required An array of the user's scores for each hole. A 0 value indicates the hole was skipped by the user. Array size MUST match "holes" parameter.
putts base 64 encoded, serialized array optional An array of the user's putts for each hole. Array size MUST match "holes" parameter.
penalty base 64 encoded, serialized array optional An array of the user's penalty shots for each hole. Array size MUST match "holes" parameter.
holenotes base 64 encoded, serialized array optional An array of the user's notes for each hole. Array size MUST match "holes" parameter.

Sample Request in PHP (using CURL):



Response Codes:

This section outlines the response codes that can be expected.

Response Code Response Message Description
3 Client Request Limit Exceeded Indicates the hourly request limit for the client has been reached.
4 Key Request Limit Exceeded Indicates the daily request limit for the API key has been reached.
5 Nonexistent Course Indicates the course being queried does not exist
6 Bad Zip Indicates the supplied zip code is invalid.
7 Bad User Credentials Indicates the supplied user credentials were invalid.
8 Score Array and Holes Played Do Not Match Indicates the "holes" field and the size of the score array do not match.
9 Putts Array and Holes Played Do Not Match Indicates the "holes" field and the size of the putts array do not match.
10 Penalty Array and Holes Played Do Not Match Indicates the "holes" field and the size of the penalty array do not match.
11 Negative or Non-Numeric Values in Score Array Indicates the score array contains negative or non-numeric values
12 Negative or Non-Numeric Values in Putts Array Indicates the putts array contains negative or non-numeric values
13 Negative or Non-Numeric Values in Penalty Array Indicates the penalty array contains negative or non-numeric values
14 Bad Date Format Indicates the supplied date is not formatted correctly.
15 Course is Extinct Indicates the course the round is being submitted for is extinct.
16 Course Not Marked as Played By User Indicates the course the round is being submitted for has not been played by the user.
17 Invalid Tee Indicates the tee associated with the round being submitted is invalid.
18 Hole Notes Array and Holes Played Do Not Match Indicates the "holes" field and the size of the hole notes array do not match.
200 OK Indicates the request completed without error.
400 Bad Request Indicates an improperly formatted API request was sent. Usually this is due to not including required variables in your request.
401 Unauthorized Indicates an invalid API request was sent.
501 Not Implemented Indicates an invalid method request was sent.