Friday API Guide (Beta)
Friday AI’s article generation can generate an article of about 500 words according to the article title and keywords, providing the ability to generate batches for application scenarios such as copywriting and SEO optimization.
Note: The API is still in beta testing, please pay attention to the compliance of the interface. Please avoid using the interface to engage in applications in non-compliant scenarios; if any illegal use is found, the Friday AI team has the right to immediately stop providing services.
Friday AI’s interface description
Call Friday AI's API using Http request
Parameter | Explination |
---|
Request Method | Post |
Request Address | openapi.heyfriday.ai/fridayapi |
Qps | 5 |
Parameter Name | Parameter Value |
---|
Content-Type | application/json; charset=UTF-8 |
Request Parameter
Parameter Name | Data Type | Optional/Required | Parameter Explination |
---|
abilityType | String | Required | Select Abilities (See list of Abilities) |
abilityInput | String | Required | Parameters required for Abilities (See list of Abilities) |
accessKeyId | String | Required | Friday AI public key |
accessKeySecret | String | Required | Friday AI private key |
Return Content
Expected Return
{
"statusCode":0,
"result":["AI……solution"]
}
1
2
3
4
Unexpected Return
{
"statusCode":10002,
"errorMsg":["run out of token"]
}
1
2
3
4
Python Call Example
import requests
postdata = {
"abilityType":"wechat_artcle_gen",
"abilityInput":{
"blogTitle":"Application of artificial intelligence in the education industry",
"keywords":["SMART classroom","Education Informatization"]
},
"accessKeyId":"your Friday accessKeyId",
"accessKeySecret":"your Friday accessKeySecret"
}
print(postdata)
r = requests.post('http://openapi.heyfriday.cn/fridayapi/',json=postdata)
print(r.json()["result"])
return r.json()["result"]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Java Call Example
Map<String, Object> postdata = new HashMap<>();
postdata.put("abilityType", "wechat_artcle_gen");
Map<String, Object> input = new HashMap<>();
input.put("blogTitle", "Application of artificial intelligence in the education industry");
List<String> keywords = new ArrayList<>();
keywords.add("SMART classroom");
keywords.add("Education Informatization");
input.put("keywords", keywords);
postdata.put("abilityInput", input);
postdata.put("accessKeyId", "your Friday accessKeyId");
postdata.put("accessKeySecret", "your Friday accessKeySecret");
String params = JSON.toJSONString(postdata);
URL url = new URL("http://openapi.heyfriday.cn/fridayapi");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Connection", "Keep-Alive");
connection.setUseCaches(false);
connection.setDoOutput(true);
connection.setDoInput(true);
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
out.write(params.getBytes(StandardCharsets.UTF_8));
out.flush();
out.close();
connection.connect();
BufferedReader in = null;
in = new BufferedReader(
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));
StringBuilder result = new StringBuilder();
String getLine;
while ((getLine = in.readLine()) != null) {
result.append(getLine);
}
in.close();
JSONObject resultJson = JSON.parseObject(result.toString());
System.out.println(resultJson.getString("result"));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Ability List
Invoke various capabilities of Friday by configuring the abilityType field
Full text generation
{
"abilityType":"en_artcle_gen",
"abilityInput":{
"keywords":["amazon","seo"]
}
}
1
2
3
4
5
6
Parameter Name | Data Type | Optional/Required | Parameter Explination |
---|
keywords | List[String] | Required | Essay Keywords |
Chinese full text generation
{
"abilityType":"wechat_artcle_gen",
"abilityInput":{
"blogTitle":"Application of artificial intelligence in the education industry",
"keywords":["SMART classroom","Education Informatization"]
}
}
1
2
3
4
5
6
7
Parameter Name | Data Type | Optional/Required | Parameter Explination |
---|
blogTitle | String | Required | Essay title |
keywords | List[String] | Required | Essay Keywords |
Error Code
Error Code | Defenition | Solution |
---|
10001 | Pre-order words have run out | Contact customer service to buy more words |
10002 | Request Timeout | Please Try Again |
10003 | Authentication failed | Check accessKeyId and accessKeySecret |
10004 | System Error | Please Try Again |
Contact us by email: friday@heyfriday.ai
Happy Content Creating