You can now filter results from the code scanning REST API based on alert severity. Use the parameter severity
to return only code scanning alerts with a specific severity. This is available at the repository and organization level.
This feature is available on GitHub.com, and will also be included in GitHub Enterprise Server (GHES) version 3.8.
Read more about the code scanning API