{"_id":"5c5d1158024c40005c4a83d3","project":"550f74bb6fc8130d0038aad3","version":{"_id":"550f75de61d9d30d00af9e01","__v":17,"project":"550f74bb6fc8130d0038aad3","forked_from":"550f74bb6fc8130d0038aad6","createdAt":"2015-03-23T02:09:34.221Z","releaseDate":"2015-03-23T02:09:34.221Z","categories":["550f75de61d9d30d00af9e02","551027e38579861900a86698","551029e08579861900a8669a","551029e7498062190006328a","5bc633a722d682005c9ad9e4","5bc633b08c4b0b000d6a7eaa","5bc633b48f3ff600626e3e18","5bc63538e5a6ba000d22ee6d","5bc63587a18a6b000decd295","5bc635c0937fcb0056223d9c","5bc6360f42f41800319aeaa6","5be5d13ff1d319002baca9ce","5be5d2287cd14d00291fbfdb","5be8b3b09f7cb70023c56a39","5be8b3cbb910100044e20206","5c1d769a4f6aed001fe527f0","5c402942010f0d001496dded"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3"},"category":{"_id":"5be5d13ff1d319002baca9ce","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2018-11-09T18:26:07.698Z","from_sync":false,"order":0,"slug":"getting-started","title":"Wyre API"},"user":"54eb8076867e1917009b7160","__v":0,"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-02-08T05:19:20.893Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"","language":"json","status":200}]},"settings":"","examples":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":true,"order":7,"body":"As mentioned in [Errors](doc:errors), one of the types of issues you may encounter is an HTTP 429 `RateLimitException` response. This indicates that you have exceeded your allocated request limit, and you must retry the request.\n\nAll API requests are subject to per-IP rate limiting. A fixed bucket of requests is allocated for each IP you are calling the API from. Some API calls (such as [Create Account](doc:create-account) ) have additional rate-limiting above and beyond that of the IP.\n\nIn simple applications, when you receive an error of this type, simply wait for a short period of time (on the order of a second) and try the request again. However, in more complex concurrent server environments where your client(s) may be responsible for a high number of simultaneous API calls on behalf of many users from a small pool of IPs, you'll want to make sure that you implement an exponential backoff so that you don't DDoS yourself.\n[block:api-header]\n{\n  \"title\": \"Firewall Permit\"\n}\n[/block]\nIn these situations, you can create a *firewall permit* which will allow a set of IPs of your choosing to exceed the usual limits.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Full KYC Approval Required\",\n  \"body\": \"You can only create firewall permits using credentials that are tied to a fully approved root account. (Cannot be a subaccount)\"\n}\n[/block]\nOnce created, these permits will linger for a little longer than 24 hours. You'll need to wire up some type of cron service to perform the permit requests regularly if you'd like to retain increased access. \n\nThis helps avoid accumulation of stale configuration, as well as eases integration in some types of environments. Your participation is actively required to maintain the firewall opening as you must maintain the list of IPs yourself.\n\nUsing your [authentication method](doc:authentication) of choice, invoke either method:\n\n- `POST /v3/firewall/permit` - permits the IP of the caller\n- `POST /v3/firewall/permit?ips=1.1.1.1,2.2.2.2` - permits the supplied list of IPs\n\nYou may post up to 10 IP addresses per permit request, and may not invoke more than 5 permit requests an hour. *IPv4 only, please.*\n\nAll limits are subject to change; please ensure to use an error strategy (retrying) in the cases you do encounter `RateLimitException`s.","excerpt":"Dealing with HTTP 429s from the Wyre API","slug":"rate-limiting","type":"basic","title":"Rate Limiting"}

Rate Limiting

Dealing with HTTP 429s from the Wyre API

As mentioned in [Errors](doc:errors), one of the types of issues you may encounter is an HTTP 429 `RateLimitException` response. This indicates that you have exceeded your allocated request limit, and you must retry the request. All API requests are subject to per-IP rate limiting. A fixed bucket of requests is allocated for each IP you are calling the API from. Some API calls (such as [Create Account](doc:create-account) ) have additional rate-limiting above and beyond that of the IP. In simple applications, when you receive an error of this type, simply wait for a short period of time (on the order of a second) and try the request again. However, in more complex concurrent server environments where your client(s) may be responsible for a high number of simultaneous API calls on behalf of many users from a small pool of IPs, you'll want to make sure that you implement an exponential backoff so that you don't DDoS yourself. [block:api-header] { "title": "Firewall Permit" } [/block] In these situations, you can create a *firewall permit* which will allow a set of IPs of your choosing to exceed the usual limits. [block:callout] { "type": "warning", "title": "Full KYC Approval Required", "body": "You can only create firewall permits using credentials that are tied to a fully approved root account. (Cannot be a subaccount)" } [/block] Once created, these permits will linger for a little longer than 24 hours. You'll need to wire up some type of cron service to perform the permit requests regularly if you'd like to retain increased access. This helps avoid accumulation of stale configuration, as well as eases integration in some types of environments. Your participation is actively required to maintain the firewall opening as you must maintain the list of IPs yourself. Using your [authentication method](doc:authentication) of choice, invoke either method: - `POST /v3/firewall/permit` - permits the IP of the caller - `POST /v3/firewall/permit?ips=1.1.1.1,2.2.2.2` - permits the supplied list of IPs You may post up to 10 IP addresses per permit request, and may not invoke more than 5 permit requests an hour. *IPv4 only, please.* All limits are subject to change; please ensure to use an error strategy (retrying) in the cases you do encounter `RateLimitException`s.