• Hey all,

    I have a question regarding the sportspress API (with REST API).

    I know that I can get a list of all events by using wp-json/sportspress/v2/events

    But how can I get a list of events with specific criterias like events of a specific league or season?

    I tried using wp-json/sportspress/v2/events?filter[leagues]=leagueid but that does not work.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Brian

    (@brianmiyaji)

    @sagund07 try this:

    wp-json/sportspress/v2/events?filter[sp_league]=slug

    (Replace slug with the slug of your competition, for example primary-league)

    Thread Starter sagund07

    (@sagund07)

    Thanks!

    Is there a list of all available (sportspress) filters?
    I can’t find them in the guide. I only found the available scheme.

    Thread Starter sagund07

    (@sagund07)

    I’ve got another question.

    Is it intended that the “events” scheme in wp-json/sportspress/v2/teams/teamid contains all events of a league and not only the events of the specific team?

    Maybe an example for better understanding:

    I have four teams

    a) Test1 with the ID 1111
    b) Test2 with the ID 1112
    c) Test3 with the ID 1113
    d) Test4 with the ID 1114

    and two events

    1) Test1 vs Test2 ID: 2221
    2) Test3 vs Test4 ID: 2222

    When I call wp-json/sportspress/v2/teams/1111 (which should give me the data of Test1) the “events” scheme contains the events 2221 (correctly) AND 2222 which seems to be not correct, because Test1 is not part of event 2222. Could it be a bug or do I have an error in reasoning?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sportspress API Filter’ is closed to new replies.