Full Guide Getting Started

The Fantasy WGL Developer's API is a powerful tool that can help you develop your own excellent applications based on WGL data.

Before you start using WG Public API, explore rules and API Reference sections. You can see a sample response of each API request on its reference page.

Registering an API Key

An API Key is required to access data using the Fantasy WGL API. Registration of all API Keys is handled on the main Fantasy WGL website. For details on how to register your own API Key, please see the details in the relevant KnowledgeBase article.

Request Format

Two HTTP methods may be used in your request

  1. GET: methods: specified in the URL request.
    Example: ?<param_name>=<param_value>
  2. POST: methods: specified in HTTP request.
    Example: ?<param_name>=<param_value>

The format of all requests is the following:

http://api.fantasywgl.com/request/<API_Key>/<Request>/?<Optional_Params>

  • <API_Key> - Your individual API Key. See how to get yours above.
  • <Request> - Which API Request you are using
  • <Optional_Params> - Optional parameters for your request. See more information in the API Reference.

Response Format

The API will return data in one of two formats - JSON (Default) or XML - depending on the "output" request parameter.

The response format has the following fields:

Field Type On Success? On Error? Description
status string
  • ok - The request was successful.
  • error - The request was unsuccessful.
requestDetails array An associative array with the details of your request.
meta array, null Information about the response according to the format described in the documentation
data array The requested data, according to the format described in the documentation
error array Details about the error encountered.
{"code":"code","field":"field","message":"message","value":"value"}

Common API Errors

Code Message Description
600 REQUIRED_FIELD_MISSING One or more required fields does not have a requested value.
602 REQUEST_TEMPORARILY_UNAVAILABLE The Fantasy WGL API is currently down.
604 REQUEST_LIMIT_EXCEEDED The project has surpassed the limit of queries for that amount of time. See Using the API for more information.
610 API_KEY_NOT_PROVIDED No API key was provided with the request
611 UNAUTHORIZED_KEY_USAGE The API key included in the request did not match the list of valid sources
612 API_KEY_INVALID The API key included in the request was not found or is inactive
613 INVALID_OUTPUT_FORMAT The output format was not valid. Valid formats include:
  • json (default)
  • xml
620 NO_REQUEST_PROVIDED There was no request sent to the server
621 REQUEST_NOT_FOUND The specified request has not been found