Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Article Forge API Specifications

Last Updated on Jan 26, 2023.

All API methods accept POST requests using the following url format:

https://af.articleforge.com/api/nameOfMethod

Where the nameOfMethod is the method name you will request. The whole list of method names and their usages are shown later.
For every api call, you must pass the post variable ‘key’, which is your API key.

Below is an example in PHP to list all the articles you have:


$ch = curl_init('https://af.articleforge.com/api/view_articles');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS,
"key=$yourkey&variable1=$valueforvar1&variable2=$valueforvar2");
$result = curl_exec($ch);
curl_close ($ch);
//$result now has the output of the API call

In this example the ‘nameOfMethod’ is view_articles, while each variable is an individual POST variable that must be set. For
view_articles, you only need to provide 'key' variable. The rest of variables (variable1 and variable2) are used to show you how you
can pass other variables.

Return Values

All returns are provided in json format. Each response always has the “status” element which is either “Fail” or “Success”. If it is “Fail”
there will always be an “error_message” that contains the specific error message. For instance here would be the response you gave
if you provided an incorrect key:
{
"status":"Fail",
"error_message":"Bad Key"
}

List of Methods

check_usage

Method URL: https://af.articleforge.com/api/check_usage

Parameters(POST): key

Description: Returns in json format the usage of your account. Prepaid Words Available is the words remaining from your prepay
amount. Monthly Words Remaining is the words remaining from your monthly free usage. Overage Usage Charge is the overage charge
after the deduction of your prepay amount.

Example output:
{
"status": "Success",
"API Requests": 100,
"Monthly Words Remaining": 0,
"Overuse Protection": "NO",
"Prepaid Amount": "$20.00",
"Prepaid Words Available": 0,
"Overage Usage Charge": "$0.25"
}

view_articles

Method URL: https://af.articleforge.com/api/view_articles

Parameters(POST): key

Description: Returns in json format all articles in descending order. You can provide an optional parameter limit to limit the number
of the returned results.

Example output:
{
"data": [
{
"id": "2",
"title": "Title2",
"created_at": "2015-08-24T14:36:17.000Z",
"keyword": "Your Keyword"
},
{
"id": "1",
"title": "Title1",
"created_at": "2015-08-23T14:36:17.000Z",
"keyword": "Your Keyword"
}
],
"status": "Success"
}

view_article

Method URL: https://af.articleforge.com/api/view_article

Parameters(POST): key, article_id

Optional Parameters: spintax_view. It should be either not set, 0, or 1 (default is set to 0). If you have WordAi enabled, it is useful to
set it to 1 to view the spintax version of your article. If you have WordAi enabled but do not use this parameter or set it to 0, it will
return a spun version of the article. If you DO NOT have WordAi enabled, this endpoint will return the article.

Description: Returns in json format the article with article_id.

Example output:

{
"data": "Your Article",
"status": "Success"
}

view_spintax

(Deprecated soon, use view_article instead)

Method URL: https://af.articleforge.com/api/view_spintax

Parameters(POST): key, article_id

Description: Returns in json format the spintax for the article with article_id.

Example output:

{
"data": "Your Article",
"status": "Success"
}

view_spin

(Deprecated soon, use view_article instead)

Method URL: https://af.articleforge.com/api/view_spin

Parameters(POST): key, article_id

Description: Returns in json format a spin for the article with article_id.

Example output:

{
"data": "Your Article",
"status": "Success"
}

initiate_article

Method URL: https://af.articleforge.com/api/initiate_article

Parameters(POST): key, keyword

keyword should not contain URLs, commas, parentheses, brackets, or too many single characters.
Optional Parameters: length, title, image, video, auto_links, turing_spinner, quality, rewrite_num, uniqueness, use_section_heading,
section_headings, excluded_topics, instructions

Here are the optional parameters you can provide with the request:

length: the length of the article. It can be either 'very_short'(approximately 50 words), 'short'(approximately 250 words),
'medium'(approximately 500 words), 'long'(approximately 750 words), or 'very_long'(approximately 1,500 words). The default value is
'short'. When length is set to 'very_long', use_section_heading must be set to 1. When length is set to 'very_short' or 'short',
use_section_heading must be either 0 or not provided.

title: It can be either 0 or 1. If it is set to be 0, the article generated is without titles. The default value is 0. If use_section_heading is
set to 1, title will be automatically set to 1.

image: the probability of adding an image into the article. It should be a float number from 0.00 to 1.00. The default value is 0.00.

video: the probability of adding a video into the article. It should be a float number from 0.00 to 1.00. The default value is 0.00.

auto_links:
replace specific keyword within the article with a designated link. You can choose whether to replace just the first
occurrence or all of them. The data structure should be an array following this pattern: [keyword1, url1, all_occurrence?, keyword2,
url2, all_occurrence?,...]

An example scenario would be:

Replace 'keyword1' with 'www.keyword1.com' (Only first occurrence), Replace keyword2 with 'www.keyword2.com' (All occurrences)

auto_links should be as follows:


["keyword1","www.keyword1.com", false, "keyword2", "www.keyword2.com", true]

Note: The array NEEDS to be a multiple of 3.

The following parameters are only available when your account is linked to valid WordAi API key. You can go to this URL
(https://af.articleforge.com/users/edit) to update your WordAi API key. Overwrite any of these parameters without a valid WordAi
API key linked to your account will get an error.

turing_spinner: enable WordAi rewrite or not. It can be either 0(disabled) or 1(enabled). The default value is 0.

quality (legacy): the quality of article. It can be either 1(Regular), 2(Unique), 3(Unique), 4(Readable), or 5(Readable). Repetitive values
are caused by compatibility issue due to WordAi version update. Note: set this parameter will automatically enable WordAi rewrite
(set turing_spinner to 1). If turing_spinner is set to 1, the default value of quality is 4.

rewrite_num: the number of rewrites you'd like WordAi to create for your article. Must be an integer ranging from 1 to 10. Note: set
this parameter will automatically enable WordAi rewrite (set turing_spinner to 1). If turing_spinner is set to 1, the default value of
rewrite_num is 5.

uniqueness: uniqueness setting of WordAi. If this is set we will ignore legacy parameter quality. uniqueness is an integer ranging from
1 to 3. 1 stands for More conservative, 2 stands for Regular, and 3 stands for More adventurous. Note: set this parameter will
automatically enable WordAi rewrite (set turing_spinner to 1). If turing_spinner is set to 1, the default value of uniqueness is 1.

use_section_heading: It can be either 0 or 1. If it is set to 0, the article generated will not include section headings. The default value is
0. If use_section_heading is set to 1, title will be automatically set to 1. When length is set to 'very_long', use_section_heading must be
set to 1. When length is set to 'very_short' or 'short', use_section_heading must be either 0 or not provided.

section_headings: String. A list of section headings separated by comma (e.g. sectionHeading1,sectionHeading2,sectionHeading3).


Each section heading should not exceed 50 characters. The number of section headings should meet the requirement based on the
length of article. If use_section_heading is not set or set to 0, section_headings will be ignored. section_headings should not contain
URLs, parentheses, brackets, or too many single characters.

excluded_topics:
String. A list of topics you don't want Article Forge to write about. This could be competitors you don't want
mentioned, topics you don't want brought up, or anything else you want Article Forge to avoid when writing your article. Separated
by comma (e.g. excludedTopic1,excludedTopic2,excludedTopic3). Each topic should not exceed 100 characters and 10 words. The
maximum number of topics is 5.

instructions: String. A command to tell Article Forge what you want to write about.(e.g: Write an article about the best beaches in
Florida including St. Pete beach, Miami beach, Jax beach, and James Lee Beach). No more than 500 characters and cannot contain
URLs.

Description: Initiates an article with keyword keyword with given settings. Returns in json format the ref_key which will be used in
get_api_progress method mentioned below. This API call has usage restrictions - to view the specific limitations for your account visit
https://af.articleforge.com/api_info
Example output:

{
"ref_key": 12345,
"status": "Success"
}

get_api_progress

Method URL: https://af.articleforge.com/api/get_api_progress

Parameters(POST): key, ref_key

Description: Returns an api status code api_status along with a float number between 0.0 and 1.0 to show the progress of the
article identified by ref_key. Possible api status codes are 0 (the article has not been started yet), 200 (the article is in process), 201
(the article has been finished). Once it is 201, you can call get_api_article_result method mentioned below to get the content of the
generated article.

It might also return api status codes other than the above mentioned three. In these case it means the article failed on our end and
status will be set to be 'Fail' and an error_message will be provided.

Note: We recommend you to use api_status to check if your article is started, in process, finished, or failed.

Example output:

{
"api_status": 200,
"progress": 0.45,
"status": "Success"
}

get_api_article_result

Method URL: https://af.articleforge.com/api/get_api_article_result

Parameters(POST): key, ref_key

Description: Returns the article id and the article identified by ref_key.

Example output:

{
"article": "Your Article.",
"article_id": 12345,
"status": "Success"
}

delete_article

Method URL: https://af.articleforge.com/api/delete_article

Parameters(POST): key, article_id

Description: Returns status success if article is successfully deleted.

Example output:

{
"status": "Success"
}

{
"status": "Fail",
"error_message": "Article Id Invalid"
}

You might also like