From 473b365ec9d3b0a2af9a92172a12a19fa14eb128 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 13 Oct 2015 14:57:22 +0200 Subject: [PATCH 1/2] add documentation about the rate limiter behaviour --- api-keys-rate-limits.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/api-keys-rate-limits.md b/api-keys-rate-limits.md index 107d7b7..4b9ecff 100644 --- a/api-keys-rate-limits.md +++ b/api-keys-rate-limits.md @@ -18,5 +18,39 @@ Mapzen Search allows you a maximum of: If you need more capacity, contact [search@mapzen.com](mailto:search@mapzen.com). You can also set up your own instance of [Pelias](https://github.com/pelias/pelias), which has access to the same data used in Mapzen Search. +## Failing to provide an `api_key` +If you fail to supply the `api_key` parameter the service will respond with the status code `403 Forbidden`: +```bash +{ + "meta": { + "version": 1, + "status_code": 403 + }, + "results": { + "error": { + "type": "KeyError", + "message": "No api_key specified." + } + } +} +``` + +## Exceeding your limits +If you exceed your limits the service will respond with the status code `429 Too Many Requests`: +```bash +{ + "meta": { + "version": 1, + "status_code": 429 + }, + "results": { + "error": { + "type": "QpsExceededError", + "message": "Queries per second exceeded: Queries exceeded (6 allowed)." + } + } +} +``` + ## Security Mapzen Search works over HTTPS, in addition to HTTP. You are strongly encouraged to use HTTPS for all requests, especially for queries involving potentially sensitive information, such as a user's location or search query. From b842aea02a14cf573681107c6330ba529d65e023 Mon Sep 17 00:00:00 2001 From: Rhonda Glennon Date: Tue, 13 Oct 2015 11:07:21 -0700 Subject: [PATCH 2/2] Add commas --- api-keys-rate-limits.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-keys-rate-limits.md b/api-keys-rate-limits.md index 4b9ecff..d1e53fa 100644 --- a/api-keys-rate-limits.md +++ b/api-keys-rate-limits.md @@ -19,7 +19,7 @@ Mapzen Search allows you a maximum of: If you need more capacity, contact [search@mapzen.com](mailto:search@mapzen.com). You can also set up your own instance of [Pelias](https://github.com/pelias/pelias), which has access to the same data used in Mapzen Search. ## Failing to provide an `api_key` -If you fail to supply the `api_key` parameter the service will respond with the status code `403 Forbidden`: +If you fail to supply the `api_key` parameter, the service will respond with the status code `403 Forbidden`: ```bash { "meta": { @@ -36,7 +36,7 @@ If you fail to supply the `api_key` parameter the service will respond with the ``` ## Exceeding your limits -If you exceed your limits the service will respond with the status code `429 Too Many Requests`: +If you exceed your limits, the service will respond with the status code `429 Too Many Requests`: ```bash { "meta": {