Sign Up

Log In

Text-Processing

FREEMIUM
By japerk
Updated 2 months ago
Other
9.5/10
Popularity Score
292ms
Latency
34%
Success Rate
joannafinkelstein3 years ago
Bought Subscription But Still Have Daily LimitMashape Support sent me to you. I bought the mega subscription to the NLTK API, but it still has the daily limit of 5,000 for me. I have a python script on my desktop that makes curl requests to the API. After I make 5,000 requests (successfully), it stops giving replies (labels) to my requests. It says Throttled. Can you fix this?
japerk3 years ago
Yes, the X-Mashape-Key should be the same as what's show in the code examples. What you should do is wrap each call in a try-except block. Here's a tutorial: https://wiki.python.org/moin/HandlingExceptions If the call fails, you could maybe try it again using something like this: https://pypi.python.org/pypi/retry When you're doing lots API calls, things can sometimes fail for random reasons, so it's a good idea to try to handle those using a retry strategy. You can tell when a request succeeds if the response.code is 200.
joannafinkelstein3 years ago
How do I know what my "X-Mashape-Key" is? Is it the same as in the code example for Python? Is there some way to check that the request received a response properly so that it doesn't crash if for some reason one request doesn't work? Also, after making some number (between 1 and 1000) successful requests, I got an error that I don't understand. This is what Terminal says: Traceback (most recent call last): File "parserCSV.py", line 157, in <module> "text": comment File "/Library/Python/2.7/site-packages/unirest/__init__.py", line 144, in post return __dorequest("POST", url, get_parameters(kwargs), kwargs.get(HEADERS_KEY, {}), kwargs.get(AUTH_KEY, None), kwargs.get(CALLBACK_KEY, None)) File "/Library/Python/2.7/site-packages/unirest/__init__.py", line 174, in __dorequest return __request(method, url, params, headers, auth) File "/Library/Python/2.7/site-packages/unirest/__init__.py", line 97, in __request response = urllib2.urlopen(req, timeout=_timeout) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open response = self._open(req, data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open '_open', req) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain result = func(*args) File "/Library/Python/2.7/site-packages/poster/streaminghttp.py", line 170, in https_open return self.do_open(StreamingHTTPSConnection, req) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open raise URLError(err) urllib2.URLError: <urlopen error ('_ssl.c:574: The handshake operation timed out',)>
japerk3 years ago
Take a look at the docs at https://market.mashape.com/japerk/text-processing. On the right side, there are client examples, and you can select Python to see code examples using the Unirest client. More details & how to install Unirest python: http://unirest.io/python.html
joannafinkelstein3 years ago
Yes, I'm still using API for text-processing.com how do I go through the Mashape API, using their client library to make requests?
japerk3 years ago
Are you making the requests thru the Mashape API, or are you still using API for text-processing.com? You need to go thru the Mashape API, using their client library to make requests, in order to get past the normal limits.
Hi Developer, feel free to post your answer:
Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://japerk-text-processing.p.rapidapi.com/phrases/")
.header("X-RapidAPI-Host", "undefined")
.header("X-RapidAPI-Key", "undefined")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("language=undefined")
.send("text=<required>")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication

Sign up for free

to test this endpoint

Join the world’s largest API marketplace with over half a million developers and thousands of APIs.
DiscoverAPIs
Testfrom the browser
Connectusing code snippets
Managefrom one dashboard