Sonarr/Sonarr · error · ImportListException
Simkl API call resulted in an unexpected StatusCode [{0}]
Error message
Simkl API call resulted in an unexpected StatusCode [{0}] What it means
Thrown as an ImportListException during the PreProcess step of the Simkl import list parser when the HTTP response from the Simkl API has a status code other than 200 OK. This is the same guard pattern used across all import list parsers — it ensures the API is reachable before attempting to parse the JSON response.
Source
Thrown at src/NzbDrone.Core/ImportLists/Simkl/SimklParser.cs:77
foreach (var show in jsonResponse.Shows)
{
series.AddIfNotNull(new ImportListItemInfo
{
Title = show.Show.Title,
TvdbId = int.TryParse(show.Show.Ids.Tvdb, out var tvdbId) ? tvdbId : 0,
ImdbId = show.Show.Ids.Imdb,
});
}
}
return series;
}
protected virtual bool PreProcess(ImportListResponse netImportResponse)
{
if (netImportResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
{
throw new ImportListException(netImportResponse, "Simkl API call resulted in an unexpected StatusCode [{0}]", netImportResponse.HttpResponse.StatusCode);
}
if (netImportResponse.HttpResponse.Headers.ContentType != null && netImportResponse.HttpResponse.Headers.ContentType.Contains("text/json") &&
netImportResponse.HttpRequest.Headers.Accept != null && !netImportResponse.HttpRequest.Headers.Accept.Contains("text/json"))
{
throw new ImportListException(netImportResponse, "Simkl API responded with html content. Site is likely blocked or unavailable.");
}
return true;
}
}
}
View on GitHub (pinned to da2284d7ea)
Solutions
- Verify the Simkl API key and user token are correctly configured in the import list settings
- Check the full exception message for the specific status code
- Test connectivity to api.simkl.com from the Sonarr server
- Re-authenticate with Simkl if the token has expired
Defensive patterns
Strategy: try-catch
Validate before calling
// Check Simkl API key and token before fetching
if (string.IsNullOrWhiteSpace(settings.ApiKey))
{
_logger.Warn("Simkl API key is not configured.");
return new ImportListFetchResult();
} Try / catch
try
{
var result = simklImport.Fetch();
}
catch (ImportListException ex) when (ex.Message.Contains("unexpected StatusCode"))
{
_logger.Warn(ex, "Simkl API returned non-200 status. Check API key and token.");
} Prevention
- Verify the Simkl API key (client ID) is correctly configured
- Re-authenticate with Simkl periodically to keep the access token fresh
- Monitor Simkl API status pages for outages
When it happens
Trigger: The Simkl API endpoint returns a non-200 status: 401 (API key invalid or expired), 403 (forbidden), 429 (rate limited), 500/502/503 (Simkl server error). The actual status code is formatted into the exception message.
Common situations: The Simkl API key (client ID) is missing or invalid in the import list settings, the Simkl user token has expired, the Simkl service is down, or network connectivity to simkl.com is blocked.
Related errors
- Plex API call resulted in an unexpected StatusCode [{0}]
- Trakt API call resulted in an unexpected StatusCode [{0}]
- Anilist API call resulted in an unexpected StatusCode [{0}]
- Request resulted in an unexpected StatusCode [{0}]
- Simkl API responded with html content. Site is likely blocke
AI-assisted analysis of Sonarr/Sonarr@da2284d7ea (2026-08-13).
Data as JSON: /api/errors/80c4171a0a9a5eef.
Report an issue: GitHub.