Invalid_session_information

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickpick
    Junior Member
    • Jul 2023
    • 2

    #1

    Invalid_session_information

    The below code used to work until this morning. Now I get INVALID_SESSION_INFORMATION. I check the API key and it says it's active and all good. What has changed since yesterday?

    import logging
    import time
    import betfairlightweight
    from flumine import Flumine, clients
    from flumine.streams.datastream import DataStream
    from market_recorder import MarketRecorder
    from pythonjsonlogger import jsonlogger
    username = "xxxxxxx"
    password = "xxxxx"
    cert_file = "betfair.pem"
    dev_app = "xxxxxxxx"
    prod_app ="xxxxxxx"
    logger = logging.getLogger()
    custom_format = "%(asctime) %(levelname) %(message)"
    log_handler = logging.StreamHandler()
    formatter = jsonlogger.JsonFormatter(custom_format)
    formatter.converter = time.gmtime
    log_handler.setFormatter(formatter)
    logger.addHandler(log_handler)
    logger.setLevel(logging.INFO)
    trading = betfairlightweight.APIClient(username, password, app_key=prod_app)
    client = clients.BetfairClient(trading)
    framework = Flumine(client=client)
    strategy = MarketRecorder(
    name="WIN",
    market_filter=betfairlightweight.filters.streaming _market_filter(
    event_type_ids=["7"],
    country_codes=["GB", "IE"],
    market_types=["WIN"],
    ),
    stream_class=DataStream,
    context={
    "local_dir": "/tmp",
    "force_update": False,
    "remove_file": True,
    "remove_gz_file": False,
    },
    )
    framework.add_strategy(strategy)
    framework.run()​
  • BetfairDeveloperProgram
    Administrator
    • Oct 2008
    • 680

    #2
    Hi nickpick.

    INVALID_SESSION_INFORMATION indicates that your previous login session has expired, you'll need to login again to create a new session token.

    See further information via https://docs.developer.betfair.com/d...sionManagement

    Kind Regards

    Neil​

    Comment

    • nickpick
      Junior Member
      • Jul 2023
      • 2

      #3
      Suddenly working again, without having made any changes. It seems that the streaming has limits in terms of how many countries can be streamed at the same time. Is this documented somewhere?

      Comment

      • BetfairDeveloperProgram
        Administrator
        • Oct 2008
        • 680

        #4
        Hi nickpick

        Thanks for confirming. There is no specific limit relating to how many countries can be streamed.

        There's a default maximum number of markets you can cover in one Stream API subscription which is 200. By default you have 10 connections available each of which can contain a separate subscription.

        Kind Regards

        Neil

        Comment

        Working...
        X