AthleteReg Event Search GraphQL API

This returns event search results in the same way the event calendar retrieves them, and is the recommended way to get event data. It is faster and more flexible than the REST API, but does not currently have the full dataset that the REST API does.
See the GraphQL documentation for more information on how to use GraphQL.

Endpoint

Requests should be POST requests to https://outsideapi.com/fed-gw/graphql

Queries

"Resolver for getting an event by Id
**Returns:** the event, and any associated information resolved by the query"
athleticEvent(
"AthleteReg site to get event from"
appType: ApplicationType!
"athletic event id"
id: Int!
): AthleticEvent

"Resolver for getting an event by it's URL (static or vanity)
**Returns:** the event and associated resolved information"
athleticEventByURL(
"Complete Event URL (static or vanity)"
url: String
): AthleticEvent

"Get event types for a given application type
**Returns:** List of the event types for the given app type with the given priority"
athleticEventTypes(
"The application type to get event types for"
appType: ApplicationType!
"If provided, only return event types with these priorities"
typePriorities: [Int!]
): [EventType]

"Get all sanctioning bodies that events can be sanctioned by
**Returns:** List of all sanctioning bodies"
ARegSanctioningBodies: [ARegSanctioningBody]

"Gets athletic events in the order they should appear on the event calendar
**Returns:** A database query for athletic events"
athleticEventCalendar(
"Filtering options for the calendar search"
searchParameters: SearchEventQueryParamsInput
"Returns the first _n_ elements from the list."
first: Int
"Returns the elements in the list that come after the specified cursor."
after: String
"Returns the last _n_ elements from the list."
last: Int
"Returns the elements in the list that come before the specified cursor."
before: String
): AthleticEventCalendarConnection

Types

type ARegSanctioningBody {
id: Int!
name: String
"The site this sanctioning body sanctions events on"
appType: ApplicationType!
}

"Relates a sanctioning body to an event that is sanctioned by them"
type ARegSanctioningBodyEventInfo {
"Get the name of the sanctioning body for the event
**Returns:** String name of the associated sanctioning body"
sanctioningBodyName: String @cacheControl(maxAge: 0)
eventID: Int!
appType: ApplicationType!
sanctioningBodyID: Int!
}

"GraphQL representation of EventHeaderInfo"
type AthleticEvent implements IAthleticEventDisplay
@cacheControl(maxAge: 30)
@key(fields: "staticUrl") {
"Get the URL of the event's header photo
**Returns:** The URL of the event's photo banner"
coverPhoto(
"Which image size to get"
imageSize: ImageSize! = FULL_SIZE
): String
"The URL of the event's logo"
logo(imageSize: ImageSize! = FULL_SIZE): String
"Get the event type names from the DB, or cached list. These are strings that can differ based on the application type
**Returns:** IEnumerable of event types for this event"
eventTypes: [String]! @cacheControl(maxAge: 0)
"Get the sanctioning bodies for this event
**Returns:** List of the sanctioning bodies that are associated with this event"
sanctioningBodies: [ARegSanctioningBodyEventInfo] @cacheControl(maxAge: 0)
"Resolver for loading the event's categories
**Returns:** Set of EventCategory associated with this event"
categories: [EventCategory] @cacheControl(maxAge: 0)
"Resolver for loading all the event's category dates
**Returns:** List of Dates associated with the event"
eventDates: [Date!] @cacheControl(maxAge: 0)
"Plaintext of the event name"
name: String
"ID in the given application of the athletic event"
eventId: ID!
"String given by the event director to use in the URL. Not a full URL."
vanityUrl: String
"Which AthleteReg site the data is on"
appType: ApplicationType!
"Full URL that will always refer to this event"
staticUrl: String!
"Full URL chosen by the event director. Note this is not guaranteed to lead to this event as directors reuse these, and it can change"
eventUrl: String!
"City the event is happening in"
city: String
"State the event is happening in"
state: String
"Zip code for the event (not necessarily US)"
zip: String
"Date of the earliest category in the event"
date: DateTime!
"Date of the latest category in the event"
eventEndDate: DateTime!
"When registration closes for the event"
closeRegDate: DateTime!
"First opportunity to register for the event"
openRegDate: DateTime!
"True if users are currently able to register for the event"
isOpen: Boolean!
"True if the event director has paid to visually highlight this event"
isHighlighted: Boolean!
"Latitude for event precise location"
latitude: Float
"Longitude for event precise location"
longitude: Float
}

"A connection to a list of items."
type AthleticEventCalendarConnection {
"Information to aid in pagination."
pageInfo: PageInfo!
"A list of edges."
edges: [AthleticEventCalendarEdge!]
"A flattened list of the nodes."
nodes: [AthleticEventSearchContainer]
"Identifies the total count of items in the connection."
totalCount: Int! @cacheControl(maxAge: 0)
}

"An edge in a connection."
type AthleticEventCalendarEdge {
"A cursor for use in pagination."
cursor: String!
"The item at the end of the edge."
node: AthleticEventSearchContainer
}

type AthleticEventSearchContainer {
"Retrieves the associated Athletic Event object from the DB
**Returns:** The athletic event associated with the searchEvent. Multiple"
athleticEvent: IAthleticEventDisplay @cacheControl(maxAge: 0)
"ID for the search information"
id: ID!
"Event id of the event on the specific reg site - not unique betw"
eventId: Int!
"The reg site the event lives on"
appType: ApplicationType!
"Earliest date of the event. If the current entry is a sub-entry, this is the first date of the group of category dates"
startDate: DateTime!
"Latest date of the event. If the current entry is a sub-entry, this is the last date of the group of category dates"
endDate: DateTime!
"Date that registration opens for the event"
openRegDate: DateTime!
"Date that registration closes for the event"
closeRegDate: DateTime!
"Sanctioning body ID of the event. Null if not sanctioned"
sanctioningBodyId: Int
"Permit number of a sanctioned event"
permitNumber: String
"Display name of the event"
name: String
"City the event is in"
city: String
"Geographic state the event is in"
state: String
"Promoter ID who owns the event. The same ID can refer to different promoters if the event is on different reg sites"
promoterId: Int!
"Minimum distance of a category on the event in meters. Null if no categories have a linear distance"
minDistanceMeters: Int
"Maximum distance of a category on the event in meters. Null if no categories have a linear distance"
maxDistanceMeters: Int
"Minimum distance of a category on the event in minutes. Null if no categories have a time distance"
minDistanceMinutes: Int
"Maximum distance of a category on the event in minutes. Null if no categories have a time distance"
maxDistanceMinutes: Int
"String of event distances to display in the UI"
distanceString: String
"Latitude of the event location"
latitude: Float
"Longitude of the event location"
longitude: Float
"What type of event entry this is"
searchEntryType: SearchEntryType!
"If the event is a membership event"
isMembership: Int!
"Level of promotion the event director has paid for"
promotionLevel: Int!
}

type EventCategory {
"Resolver for loading the category's dates.\nIf you don't need category specific data, use the EventDates property on the event instead
**Returns:** List of Dates associated with the category"
raceDates: [Date!] @cacheControl(maxAge: 0)
"The distance unit for the category (i.e. miles or minutes)
**Returns:** distance units the category is using"
distanceUnit: String @cacheControl(maxAge: 0)
"Name of the event category, often a race but can be almost anything other than merchandise"
name: String
"Category ID"
raceRecId: ID
"This category's start time"
startTime: DateTime
"Which AthleteReg site the data is on"
appType: ApplicationType!
"ID of the athletic event this category is part of"
eventId: Int!
"Distance for this event. Can be quite varied. Do not use without the unit."
distance: String
}

input EventDistanceFilterInput {
"User latitude to search from"
latitude: Decimal!
"User longitude to search from"
longitude: Decimal!
"Maximum distance from the user, in miles"
distance: Float!
}


type EventType {
typeID: Int!
typeDesc: String
typePriority: Int
"Whether this event type should show up as a filter on the calendar"
filterableOnCalendar: Boolean!
"Color in hex that determines how an Event Type will be displayed on the calendar as a color coded key in the Filters section"
mapKeyColor: String
}

interface IAthleticEventDisplay {
"Get the event type names from the DB, or cached list. These are strings that can differ based on the application type
**Returns:** IEnumerable of event types for this event"
eventTypes: [String]
"Plaintext of the event name"
name: String
"Full URL chosen by the event director. Note this is not guaranteed to lead to this event as directors reuse these, and it can change"
eventUrl: String
"Date of the earliest category in the event"
date: DateTime!
"Date of the latest category in the event"
eventEndDate: DateTime!
"City the event is happening in"
city: String
"State the event is happening in"
state: String
"Longitude for event precise location"
longitude: Float
"Latitude for event precise location"
latitude: Float
"Zip code for the event (not necessarily US)"
zip: String
}


input LatLongInput {
latitude: Decimal!
longitude: Decimal!
}

"Information about pagination in a connection."
type PageInfo {
"Indicates whether more edges exist following the set defined by the clients arguments."
hasNextPage: Boolean!
"Indicates whether more edges exist prior the set defined by the clients arguments."
hasPreviousPage: Boolean!
"When paginating backwards, the cursor to continue."
startCursor: String
"When paginating forwards, the cursor to continue."
endCursor: String
}


"Filters for event search queries. Separate fields are all ANDed together"
input SearchEventQueryParamsInput {
"Earliest start date of the event"
minDate: DateTime
"Latest start date of the event"
maxDate: DateTime
"Websites to get events from"
appTypes: [ApplicationType!]
"Event types to filter to - do not use if displaying more than one app type"
eventTypes: [Int!]
"If provided, the query will only return events that are in these states.\nStates are two-letter abbreviations such as \"NY\" or \"BC\"."
eventStates: [String]
"Sanctioning bodies to filter events to."
sanctioningBodies: [Int!]
"Search for text contained in the event name or event city"
searchText: String
"True if events should be past the registration open date (does not guarantee event is not full)"
isRegistrationOpen: Boolean
"Event promoter to limit events to. - do not use if displaying more than one app type"
promoterId: Int
"Minimum category length. Unit determined by LengthUnit"
minLength: Int
"Maximum category length. Unit determined by LengthUnit"
maxLength: Int
"Unit for category lengths. Required if MinLength or MaxLength are set"
lengthUnit: EventSearchDistanceUnit
"Information about user location and filtering distance"
userDistanceFilter: EventDistanceFilterInput
"If provided, the query will only return events that are in these states.\nStates are two-letter abbreviations such as \"NY\" or \"BC\"."
states: [String]
"True to only get full event listings, rather than listings separated by gaps in the calendar\naka get only one listing per event"
fullEventsOnly: Boolean
}

Enums

"Application type (usually the website name)"
enum ApplicationType {
BIKEREG
SKIREG
RUNREG
TRIREG
}

enum ImageSize {
FULL_SIZE
THUMBNAIL
MOBILE
}
"Units that can be stored in the SearchEventCategoryDistances table\nIf units can be converted between each other, they shouldn't be added here and instead converted to an existing unit"
enum EventSearchDistanceUnit {
METERS
MINUTES
}
enum SearchEntryType {
ONLY_ENTRY
COMPLETE_EVENT
SUB_ENTRY
EXTERNAL_EVENT
}


TriReg.com Event Search REST API

This returns event search results similar to the event calendar in JSON format. This query is slower than the GraphQL API, we recommend using that if you are able.

Endpoint

Requests should be GET requests directed to http://www.TriReg.com/api/search.

Parameters

All parameters are passed via query string and are optional. Parameter names are case-sensitive. Results are limited to the first 100 matches and ordered chronologically ascending.

Parameter Notes
name A string of characters to search for in the event name, i.e. "Gloucester"
region A region to restrict the search to. Legal values for this are the set of choices in the "Event Location" drop down box on the event search page above the first set of dashes, i.e. "New England" is valid but "American Samoa" is not.
states A comma-separated list of two-character state abbreviations to restrict the search to, i.e. "ME,NH,VT"
loc A base location for the search. If this is included, results will have a "distance" property that represents how far away each result is from the given point. Points should be specified in the format "lat|long".
distance Restricts search results to those within distance miles of loc. If loc is not specified, this has no effect.
eventtype A comma-separated list of event types to restrict the search to. Legal values for this are the set of choices in the "Event Type" drop down box on the event search page above the first set of dashes, i.e. "MTB Races" is valid but "BUMPS Hillclimb Series" is not.
permit An exact USAC permit # to match, i.e. "2014-2735"
startpage The page of results to start with, counting by 100. i.e. a startpage of "2" will return the 200-300th results for that search, if they exist.
year Restricts search to results within a given calendar year (i.e. "2014"). If all date parameters are absent (year, startdate, enddate), results will include all future events.
startDate The date to start the search from. Any event ending on or after this date will be included. If all date parameters are absent (year, startdate, enddate), results will include all future events.
endDate The date to end the search at. Any event starting on or before on or after this date will be included. If all date parameters are absent (year, startdate, enddate), results will include all future events.

You can also make a request for a specific event by supplying an event ID. This ID is in the url of the "who's registered" page, or in any event-director administration page for that event. If you supply an event ID, all other parameters are ignored. Searching by a single event ID is the only way to get a value reported in the "TotalRegistrations" field of the response.

Parameter Notes
eventID The ID of the event to look up.

Response

The response is a JSON-formatted object with two properties, "ResultCount" and "MatchingEvents." We assume you can figure out what they are.