{"_id":"56a217be2255370d00ad5ece","__v":13,"project":"55a7aee84a33f92b00b7a150","category":{"_id":"55a8fb10c8bd450d000dd130","version":"55a7aee84a33f92b00b7a153","pages":["55a8fba727a17d21005251f2","55abb16e63a6b60d006616ec","56a217be2255370d00ad5ece","56b2187ba5a1020d00cf4c53"],"project":"55a7aee84a33f92b00b7a150","__v":4,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-17T12:54:40.206Z","from_sync":false,"order":0,"slug":"getting-started","title":"Getting Started"},"user":"55a7ae50bf1be93100d89df1","version":{"_id":"55a7aee84a33f92b00b7a153","__v":6,"project":"55a7aee84a33f92b00b7a150","createdAt":"2015-07-16T13:17:28.411Z","releaseDate":"2015-07-16T13:17:28.411Z","categories":["55a7aee94a33f92b00b7a154","55a7fefa3efe0c2f0074cbdf","55a8fb10c8bd450d000dd130","55a936b1cf45e1390093f362","55abddeaa36ccd0d00fdebe1","5624db675a86b423009462e1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-22T11:51:26.647Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Based on your [subscription plan](http://developer.aylien.com/plans), your application is subject to daily and per-minute limits. There are three response headers you can use to check your quota allowance, the number of calls remaining on your quota and the time and date your quota will be reset:\n\n- `X-RateLimit-Limit`: Daily limit of your current plan\n- `X-RateLimit-Remaining`: The amount remained from your daily quota\n- `X-RateLimit-Reset`: When the quotas are reset\n\n**Note:** If you're using one of our SDKs, you can use the following methods to retrieve the above values:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"print client.RateLimits()\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"puts client.rate_limits\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"var limits = client.RateLimit\\n  \\nConsole.WriteLine(\\\"Limit: \\\" + limits[\\\"Limit\\\"]);\\nConsole.WriteLine(\\\"Remaining: \\\" + limits[\\\"Remaining\\\"]);\\nConsole.WriteLine(\\\"Reset: \\\" + limits[\\\"Reset\\\"]);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"textapi.sentiment({'text': 'John is a very good football player', function(err, result, rateLimits) {\\n  console.log(rateLimits);\\n});\",\n      \"language\": \"javascript\"\n    },\n    {\n      \"code\": \"<?php\\nvar_dump($textapi->getRateLimits());\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"TextAPIClient.RateLimits rateLimits = client.getRateLimits();\\nSystem.out.println(rateLimits.getLimit());\\nSystem.out.println(rateLimits.getRemaining());\\nSystem.out.println(rateLimits.getReset());\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"fmt.Printf(\\\"%v\\\\n\\\", client.RateLimits)\",\n      \"language\": \"go\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Caveat\",\n  \"body\": \"As these values are returned as response headers, you must make at least one **successful** API call before you can retrieve these values.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"What happens if you get rate limited a lot?\",\n  \"body\": \"If you're continually getting rate limited, we may block your application or IP. For repeat offenders, we may block your other applications as well, and disallow you from creating new applications.\"\n}\n[/block]","excerpt":"","slug":"rate-limits","type":"basic","title":"Rate Limits"}
Based on your [subscription plan](http://developer.aylien.com/plans), your application is subject to daily and per-minute limits. There are three response headers you can use to check your quota allowance, the number of calls remaining on your quota and the time and date your quota will be reset: - `X-RateLimit-Limit`: Daily limit of your current plan - `X-RateLimit-Remaining`: The amount remained from your daily quota - `X-RateLimit-Reset`: When the quotas are reset **Note:** If you're using one of our SDKs, you can use the following methods to retrieve the above values: [block:code] { "codes": [ { "code": "print client.RateLimits()", "language": "python" }, { "code": "puts client.rate_limits", "language": "ruby" }, { "code": "var limits = client.RateLimit\n \nConsole.WriteLine(\"Limit: \" + limits[\"Limit\"]);\nConsole.WriteLine(\"Remaining: \" + limits[\"Remaining\"]);\nConsole.WriteLine(\"Reset: \" + limits[\"Reset\"]);", "language": "csharp" }, { "code": "textapi.sentiment({'text': 'John is a very good football player', function(err, result, rateLimits) {\n console.log(rateLimits);\n});", "language": "javascript" }, { "code": "<?php\nvar_dump($textapi->getRateLimits());\n?>", "language": "php" }, { "code": "TextAPIClient.RateLimits rateLimits = client.getRateLimits();\nSystem.out.println(rateLimits.getLimit());\nSystem.out.println(rateLimits.getRemaining());\nSystem.out.println(rateLimits.getReset());", "language": "java" }, { "code": "fmt.Printf(\"%v\\n\", client.RateLimits)", "language": "go" } ] } [/block] [block:callout] { "type": "warning", "title": "Caveat", "body": "As these values are returned as response headers, you must make at least one **successful** API call before you can retrieve these values." } [/block] [block:callout] { "type": "danger", "title": "What happens if you get rate limited a lot?", "body": "If you're continually getting rate limited, we may block your application or IP. For repeat offenders, we may block your other applications as well, and disallow you from creating new applications." } [/block]