What is the Anomaly Detector API?


TLS 1.2 is now enforced for all HTTP requests to this service. For more information, see Azure Cognitive Services security.

The Anomaly Detector API enables you to monitor and detect abnormalities in your time series data with machine learning. The Anomaly Detector API adapts by automatically identifying and applying the best-fitting models to your data, regardless of industry, scenario, or data volume. Using your time series data, the API determines boundaries for anomaly detection, expected values, and which data points are anomalies.

Detect pattern changes in service requests

Using the Anomaly Detector doesn't require any prior experience in machine learning, and the RESTful API enables you to easily integrate the service into your applications and processes.


With the Anomaly Detector, you can automatically detect anomalies throughout your time series data, or as they occur in real-time.

Feature Description
Detect anomalies as they occur in real-time. Detect anomalies in your streaming data by using previously seen data points to determine if your latest one is an anomaly. This operation generates a model using the data points you send, and determines if the target point is an anomaly. By calling the API with each new data point you generate, you can monitor your data as it's created.
Detect anomalies throughout your data set as a batch. Use your time series to detect any anomalies that might exist throughout your data. This operation generates a model using your entire time series data, with each point analyzed with the same model.
Get additional information about your data. Get useful details about your data and any observed anomalies, including expected values, anomaly boundaries and positions.
Adjust anomaly detection boundaries. The Anomaly Detector API automatically creates boundaries for anomaly detection. Adjust these boundaries to increase or decrease the API's sensitivity to data anomalies, and better fit your data.


Check out this interactive demo to understand how Anomaly Detector works. To run the demo, you need to create an Anomaly Detector resource and get the API key and endpoint.


To learn how to call the Anomaly Detector API, try this Azure Notebook. This web-hosted Jupyter Notebook shows you how to send an API request and visualize the result.

To run the Notebook, complete the following steps:

  1. Get a valid Anomaly Detector API subscription key and an API endpoint. The section below has instructions for signing up.
  2. Sign in, and click Clone, in the upper right corner.
  3. Un-check the "public" option in the dialog box before completing the clone operation, otherwise your notebook, including any subscription keys, will be public.
  4. Click Run on free compute
  5. Select one of the notebooks.
  6. Add your valid Anomaly Detector API subscription key to the subscription_key variable.
  7. Change the endpoint variable to your endpoint. For example: https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0/timeseries/last/detect
  8. On the top menu bar, click Cell, then Run All.


The Anomaly Detector API is a RESTful web service, making it easy to call from any programming language that can make HTTP requests and parse JSON.


For best results when using the Anomaly Detector API, your JSON-formatted time series data should include:

  • data points separated by the same interval, with no more than 10% of the expected number of points missing.
  • at least 12 data points if your data doesn't have a clear seasonal pattern.
  • at least 4 pattern occurrences if your data does have a clear seasonal pattern.

You must have a Cognitive Services API account with access to the Anomaly Detector API. You can get your subscription key from the Azure portal after creating your account.

After signing up:

  1. Take your time series data and convert it into a valid JSON format. Use best practices when preparing your data to get the best results.
  2. Send a request to the Anomaly Detector API with your data.
  3. Process the API response by parsing the returned JSON message.


You can read the paper Time-Series Anomaly Detection Service at Microsoft (accepted by KDD 2019) to learn more about the SR-CNN algorithms developed by Microsoft.

Join the Anomaly Detector community

Next steps