Word Count API

Use our WriteAPI to update your word count via app or plugin!

wcapi -- what is it?

This page outlines the API for accessing the word count information for NaNoWriMo. There are five major types of information you can retrieve:

These functions are meant to be used by external tools to graphically track your wordcount data.

user wordcount

To get the current wordcount, use the following URL, using your system name.

http://nanowrimo.org/wordcount_api/wc/jezra

If you are currently logged in, your system name is shown in the example above.
You can find any user's system name by navigating to their profile page and examining the URL: the system name is the part that follows "participants/".

The current wordcount will be returned in an XML structure:

<!DOCTYPE wc [
  <!ELEMENT wc (uid, error, uname, user_wordcount)>
  <!ELEMENT uid (#PCDATA)>
  <!ELEMENT error (#PCDATA)>
  <!ELEMENT uname (#PCDATA)>
  <!ELEMENT user_wordcount (#PCDATA)>
  <!ELEMENT winner (#PCDATA)>
]>

For example, you might see:

<wc>
  <uid>30837</uid>
  <uname>NewMexicoKid</uname>
  <user_wordcount>2699</user_wordcount>
  <winner>false</winner>
</wc>

Return to the top of this page

user wordcount history

To get the wordcount history, use the following URL, using your system name.

http://nanowrimo.org/modules/wordcount_api/wchistory/ jezra

If you are currently logged in, your system name is shown in the example above.
You can find any user's system name by navigating to their profile page and examining the URL: the system name is the part that follows "participants/".

The wordcount history will be returned in an XML structure:

<!DOCTYPE wchistory [
  <!ELEMENT uid (#PCDATA)>
  <!ELEMENT error (#PCDATA)>
  <!ELEMENT uname (#PCDATA)>
  <!ELEMENT user_wordcount (#PCDATA)>
  <!ELEMENT winner (#PCDATA)>
  <!ELEMENT wordcounts (wcentry+)>
  <!ELEMENT wcentry (wc,wcdate)>
  <!ELEMENT wc (#PCDATA)>
  <!ELEMENT wcdate (#PCDATA)>
]>

For example, the output might look like:

<wchistory>
  <uid>30837</uid>
  <uname>NewMexicoKid</uname>
  <user_wordcount>25001</user_wordcount>
  <winner>false</winner>
  <wordcounts>
    <wcentry>
      <wc>2699</wc>
      <wcdate>2005-11-01</wcdate>
    </wcentry>
    <wcentry>
      <wc>2315</wc>
      <wcdate>2005-11-02</wcdate>
    </wcentry>
    <wcentry>
      <wc>6302</wc>
      <wcdate>2005-11-04</wcdate>
    </wcentry>
  </wordcounts>
</wchistory>

Return to the top of this page

site wordcount

To get the site wordcount use the following URL:

http://nanowrimo.org/wordcount_api/wcstatssummary
The site wordcount will be returned in an XML structure:
<!DOCTYPE min, max, average, stddev, count [
  <!ELEMENT error (#PCDATA)>
  <!ELEMENT wcstatssummary (site_wordcount, error,
  min, max, average, stddev, count)>
  <!ELEMENT site_wordcount (#PCDATA)>
  <!ELEMENT min (#PCDATA)>
  <!ELEMENT max (#PCDATA)>
  <!ELEMENT average (#PCDATA)>
  <!ELEMENT stddev (#PCDATA)>
  <!ELEMENT count (#PCDATA)>
]>

The final results will look like:

<wcstatssummary>
  <site_wordcount>38200</site_wordcount>
  <wcdate>2005-11-01</wcdate>
  <min>25</min>
  <max>5000</max>
  <average>1677</average>
  <stddev>350</stddev>
  <count>84579</count>
</wcstatssummary>

Return to the top of this page

site wordcount history

To get the site wordcount history,

http://nanowrimo.org/wordcount_api/wcstats
The site wordcount history will be returned in an XML structure:
<!DOCTYPE wcstats [
  <!ELEMENT error (#PCDATA)>
  <!ELEMENT wcstats (site_wordcount, error, wcentry+)>
  <!ELEMENT site_word_count (#PCDATA)>
  <!ELEMENT numparticipants (#PCDATA)>
  <!ELEMENT wordcounts (wcentry+)>
  <!ELEMENT wcentry (wc, wcdate, min, max, average, stddev, count)>
  <!ELEMENT wcdate (#PCDATA)>
  <!ELEMENT min (#PCDATA)>
  <!ELEMENT max (#PCDATA)>
  <!ELEMENT average (#PCDATA)>
  <!ELEMENT stddev (#PCDATA)>
  <!ELEMENT count (#PCDATA)>
]>

The final results will look like:

<wcstats>
  <site_word_count>38200</site_word_count>
  <numparticipants>38200</numparticipants>
  <wordcounts>
  <wcentry>
    <wc>6002234</wc>
    <wcdate>2005-11-01</wcdate>
    <min>25</min>
    <max>5000</max>
    <average>1677</average>
    <stddev>350</stddev>
    <count>84579</count>
  </wcentry>
  <wcentry>
    <wc>17823647</wc>
    <wcdate>2005-11-02</wcdate>
    <min>34</min>
    <max>50000</max>
    <average>2596</average>
    <stddev>500</stddev>
    <count>84579</count>
  </wcentry>
  <wordcounts>
</wcstats>

Return to the top of this page

regional wordcount

To get the region wordcount, use the following URL with a region system name:

http://nanowrimo.org/wordcount_api/wcregion/ usa-california-east-bay

If you are logged in and have a home region set, your home region system name has been automatically inserted into the example. You can find any region's system name by navigating to the region page and examining the URL.

The regional wordcount will be returned in an XML structure:

<!DOCTYPE wcregion [
  <!ELEMENT wcregion (rid, error, rname, region_wordcount, min, max,
  average, stddev, count, donations, numdonors)>
  <!ELEMENT rid (#PCDATA)>
  <!ELEMENT error (#PCDATA)>
  <!ELEMENT rname (#PCDATA)>
  <!ELEMENT numparticipants (#PCDATA)>
  <!ELEMENT region_wordcount (#PCDATA)>
  <!ELEMENT min (#PCDATA)>
  <!ELEMENT max (#PCDATA)>
  <!ELEMENT average (#PCDATA)>
  <!ELEMENT stddev (#PCDATA)>
  <!ELEMENT count (#PCDATA)>
  <!ELEMENT donations (#PCDATA)>
  <!ELEMENT numdonors (#PCDATA)>
]>

For example, you might see:

<wcregion>
  <rid>3</rid>
  <rname>Arizona :: Elsewhere</rname>
  <numparticipants>3564</numparticipants>
  <region_wordcount>25320</region_wordcount>
  <min>25</min>
  <max>5000</max>
  <average>1677</average>
  <stddev>350</stddev>
  <count>84579</count>
  <donations>1000.00</donations>
  <numdonors>17</numdonors>
</wcregion>

Return to the top of this page

regional wordcount history

To get the region wordcount, use the following URL with a region system name:

http://nanowrimo.org/wordcount_api/wcregionhist/ usa-california-east-bay

If you are logged in and have a home region set, your home region system name has been automatically inserted into the example. You can find any region's system name by navigating to the region page and examining the URL.

The regional wordcount history will be returned in an XML structure:

<!DOCTYPE wcregionhist [
  <!ELEMENT wcregionhist (rid, error, rname, region_wordcount,
  wordcounts)>
  <!ELEMENT rid (#PCDATA)>
  <!ELEMENT error (#PCDATA)>
  <!ELEMENT rname (#PCDATA)>
  <!ELEMENT numparticipants (#PCDATA)>
  <!ELEMENT region_wordcount (#PCDATA)>
  <!ELEMENT wordcounts (wcentry+)>
    <!ELEMENT wcentry (wc, wcdate, max, min, average, stddev, count,
    donations, numdonors)>
    <!ELEMENT wc (#PCDATA)>
    <!ELEMENT wcdate (#PCDATA)>
    <!ELEMENT min (#PCDATA)>
    <!ELEMENT max (#PCDATA)>
    <!ELEMENT average (#PCDATA)>
    <!ELEMENT stddev (#PCDATA)>
    <!ELEMENT count (#PCDATA)>
    <!ELEMENT donations (#PCDATA)>
    <!ELEMENT numdonors (#PCDATA)>
]>

For example, you might see:

<wcregionhist>
  <rid>3</rid>
  <rname>Arizona::Elsewhere</rname>
  <numparticipants>3564</numparticipants>
  <wordcounts>
    <wcentry>
        <wc>11320</wc>
        <wcdate>2005-11-01</wcdate>
        <min>34</min>
        <max>50000</max>
        <average>2596</average>
        <stddev>500</stddev>
        <count>84579</count>
        <donations>200.00</donations>
        <numdonors>4</numdonors>
      </wcentry>
      <wcentry>
        <wc>13727</wc>
        <wcdate>2005-11-02</wcdate>
        <min>34</min>
        <max>50000</max>
        <average>2596</average>
        <stddev>500</stddev>
        <count>84579</count>
        <donations>800.00</donations>
        <numdonors>10</numdonors>
      </wcentry>
      <wcentry>
        <wc>14288</wc>
        <wcdate>2005-11-03</wcdate>
        <min>34</min>
        <max>50000</max>
        <average>2596</average>
        <stddev>500</stddev>
        <count>84579</count>
        <donations>800.00</donations>
        <numdonors>10</numdonors>
      </wcentry>
      <wcentry>
        <wc>14288</wc>
        <wcdate>2005-11-04</wcdate>
        <min>34</min>
        <max>50000</max>
        <average>2596</average>
        <stddev>500</stddev>
        <count>84579</count>
        <donations>900.00</donations>
        <numdonors>16</numdonors>
      </wcentry>
      <wcentry>
        <wc>25320</wc>
        <wcdate>2005-11-05</wcdate>
        <min>34</min>
        <max>50000</max>
        <average>2596</average>
        <stddev>500</stddev>
        <count>84579</count>
        <donations>1000.00</donations>
        <numdonors>17</numdonors>
      </wcentry>
  </wordcounts>
</wcregionhist>