Send a message when the mood hits an extreme

A small script that tells you only when the market mood goes beyond limits you chose.

You need: an API key (opens in a new tab) and a place to run a daily script and send a message.

  1. Get an API key

    Create a key on the API keys (opens in a new tab) page and keep it in an environment variable, not in your code. Each request uses credits.

    The API keys page
  2. Choose two limits

    Decide the upper and lower limit, for example 75 and 25. Write them in the script.

  3. Read the index

    Once a day call get_market_index and take the latest value.

    A Python example of a request to the API
  4. Send a message only when a limit is crossed

    Compare the value with the limits. Send a message with the value and a link to the Sentiment index (opens in a new tab) only if one is crossed. Keep quiet otherwise.

  • What you will see

    A quiet script that sends one message when the market mood is beyond your limits.

  • Data used

    get_market_index through the API (opens in a new tab).

  • Limits

    • The latest value is for the previous day, so this is a daily check, not a live alert.
    • An extreme can last for weeks: send the message once per crossing.