...
Code Block | ||
---|---|---|
| ||
var sourceId = "GeniusPremium"; var sportId = 17; // American Football var from = DateTime.UtcNow.ToString("s"); var to = DateTime.UtcNow.AddDays(2).ToString("s"); var baseUrl = "https://platform.matchstate.api.geniussports.com/api/v1"; var url = $"{baseUrl}/sources/{sourceId}/sports/{sportId}/schedule?from={from}&to={to}"; var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Add("Authorization", "{ACCESS_TOKEN}"); httpClient.DefaultRequestHeaders.Add("x-api-key", "{API_KEY}"); var response = await httpClient.GetAsync(url); var responseBody = await response.Content.ReadAsStringAsync(); var schedule = JsonConvert.DeserializeObject<JArray>(responseBody); var fixtureId = schedule[0]["fixtureId"].ToString(); |
2.5. Obtaining competitor information:
You can retrieve competitor information, as well as other information such as competitions, venues, etc, from our FixtureAPI. Please note that the client credentials for the Fixture API are different from those of the Ably APIs.
Fixture API
3. Obtaining an Ably Access Token and a Channel Name
...