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

ParameterExplination
Request MethodPost
Request Addressopenapi.heyfriday.ai/fridayapi
Qps5

Header Parameter

Parameter NameParameter Value
Content-Typeapplication/json; charset=UTF-8

Request Parameter

Parameter NameData TypeOptional/RequiredParameter Explination
abilityTypeStringRequiredSelect Abilities (See list of Abilities)
abilityInputStringRequiredParameters required for Abilities (See list of Abilities)
accessKeyIdStringRequiredFriday AI public key
accessKeySecretStringRequiredFriday AI private key

Return Content

Expected Return

{
    "statusCode":0,
    "result":["AI……solution"]
}

Unexpected Return

{
    "statusCode":10002,
    "errorMsg":["run out of token"]
}

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"]

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");
// Create a new url link
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
// set header parameters
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"));

Ability List

Invoke various capabilities of Friday by configuring the abilityType field

Full text generation

{
    "abilityType":"en_artcle_gen",
    "abilityInput":{
        "keywords":["amazon","seo"]
        }
}

abilityInput

Parameter NameData TypeOptional/RequiredParameter Explination
keywordsList[String]RequiredEssay Keywords

Chinese full text generation

{
    "abilityType":"wechat_artcle_gen",
    "abilityInput":{
        "blogTitle":"Application of artificial intelligence in the education industry",
        "keywords":["SMART classroom","Education Informatization"]
        }
}

abilityInput

Parameter NameData TypeOptional/RequiredParameter Explination
blogTitleStringRequiredEssay title
keywordsList[String]RequiredEssay Keywords

Error Code

Error CodeDefenitionSolution
10001Pre-order words have run outContact customer service to buy more words
10002Request TimeoutPlease Try Again
10003Authentication failedCheck accessKeyId and accessKeySecret
10004System ErrorPlease Try Again

How to contact Friday and get API access

Contact us by email: friday@heyfriday.ai

Happy Content Creating