API list
URL | https://rewriter.ai/api/paraphraser |
---|---|
Parameter | api_key The user's authorization ID, which is set by the user. dev_key Developer ID, preset by the developer in the code text Text to process img_enabled Whether to enable AI image generation, default value: false img_count Number of images generated (min~max random), default value: 1 img_width Image width (min~max random), unit "pixel", maximum value:1024, default value: 512 img_height Image height (min~max random), unit "pixel",maximum value:1024, default value: 512 img_prompt The image is generated based on the prompt text, with multiple prompt texts separated by commas. The program will randomly generate images using prompt text. You can also leave the prompt text unset, and the system will analyze the prompt text from the article. img_position Insertion position of image in text img_align image alignment, Image alignment, optional values are: left right center random, default value: center |
Result (JSON) |
x { //If an interface call is successful, it returns a value of 200; //otherwise, it returns a value of 500. "code": 200, //Here is the result article of spin when the call is successful. //Here is the unsuccessful exception message if the call fails. "text": "Result or fail message" } |
xxxxxxxxxx
var sc_api={
post: function(url,options,callback){
var xhr;
if (window.XMLHttpRequest) {
xhr=new XMLHttpRequest();
}else{
xhr=new ActiveXObject('Microsoft.XMLHTTP');
}
xhr.onreadystatechange=function(){
if (xhr.readyState==4){
var result={code:500, text:'Network error!'};
if(xhr.status==200){
result=JSON.parse(xhr.responseText);
}
callback(result);
}
}
xhr.open('POST',url,true);
xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
var data='';
Object.keys(options).map(function(key){
data+=key+'='+encodeURIComponent(options[key])+'&';
});
xhr.send(data);
},
paraphraser:function(options,callback){
var url='https://rewriter.ai/api/paraphraser';
this.post(url,options,callback);
},
//Paraphraser asynchronous API interface:
//Call first https://rewriter.ai/api/paraphraserasync The interface submits the processing content, and it will return a ProcessingID: {"code":200,"text":"ProcessingID"}.
//Access every 10 seconds https://rewriter.ai/api/paraphraserasyncresult?id=ProcessingID Interface
paraphraser_async:function(options,callback){
var _this=this;
var url='https://rewriter.ai/api/paraphraserasync';
this.post(url,options,function(result){
if(result.code==500){
callback(result);
return;
}
_this.paraphraser_async_result({id:result.text},callback);
});
},
paraphraser_async_result:function(options,callback){
var _this=this;
window.setTimeout(function(){
var url='https://rewriter.ai/api/paraphraserasyncresult';
_this.post(url,options,function(result){
if(result.text!='processing'){
callback(result);
return;
}
_this.paraphraser_async_result(options,callback);
});
},10000);
},
grammarchecker:function(options,callback){
var url='https://rewriter.ai/api/grammarchecker';
this.post(url,options,callback);
},
summarizer:function(options,callback){
var url='https://rewriter.ai/api/summarizer';
this.post(url,options,callback);
},
translate:function(options,callback){
var url='https://rewriter.ai/api/translate';
this.post(url,options,callback);
}
};
//Execution paraphraser method
sc_api.paraphraser({
dev_key:'Developer Key',
api_key:'APIKey filled by user',
text:'hello world!'
},function(result){
console.log(result);
});
//Execution grammarchecker method
sc_api.grammarchecker({
dev_key:'Developer Key',
api_key:'APIKey filled by user',
text:'hello world!'
},function(result){
console.log(result);
});
//Execution summarizer method
sc_api.summarizer({
dev_key:'Developer Key',
api_key:'APIKey filled by user',
text:'hello world!'
},function(result){
console.log(result);
});
//Execution translate method
sc_api.translate({
dev_key:'Developer Key',
api_key:'APIKey filled by user',
text:'hello world!',
from_code:'en',
to_code:'zh'
},function(result){
console.log(result);
});
Total: 0 times
$29 one time fee
Buy Now$499 one time fee
Buy Now$99 one time fee
Buy Now