Title: API Suggestion/Help
Last modified: August 30, 2016

---

# API Suggestion/Help

 *  Resolved [th3no0b](https://wordpress.org/support/users/th3no0b/)
 * (@th3no0b)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/api-suggestionhelp/)
 * The external API seems to have very few options (I only see the ability to get
   the plugin version?), so I used the `variables.php` file instead of `external.
   php` so that I could load monthly pageviews and visitors, however I had to add
   an extra `elseif` to get pageviews. Is it possible to get this extra `elseif`
   in by default? Or should I just change all my sites’ `variables.php` to add in
   the extra statement?
 * Thanks
 * The extra `elseif`:
 *     ```
       elseif ($var=='monthtotalpageviews'){
           $qry = $wpdb->get_results(
             "SELECT count(id) AS pageview
              FROM $table_name
              WHERE
               DATE >= DATE_FORMAT(CURDATE(), '%Y%m01') AND
               spider='' and feed='';
             ");
          if ($qry != null) {
            echo $qry[0]->pageview;
          }
       }
       ```
   
 * [https://wordpress.org/plugins/newstatpress/](https://wordpress.org/plugins/newstatpress/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [lechab](https://wordpress.org/support/users/lechab/)
 * (@lechab)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/api-suggestionhelp/#post-6824777)
 * Hi th3no0b,
 * The external API is not yet fully developed.
 * I will not spoke instead of ice00, but the API will probably include other parameters
   than the version of the website 😉
    I let him reply you more precisely;
 * cHab
 *  Plugin Author [ice00](https://wordpress.org/support/users/ice00/)
 * (@ice00)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/api-suggestionhelp/#post-6824804)
 * hi,
 * variables.php is for getting some values from the DB inside WordPress where the
   server is running.
 * external.php is for getting values from the DB to external server where WordPress
   could be not installed.
 * In your case it is better to modify the variables.php and get that value (it 
   will be in version 1.1.0).
 * Just to speak about external API. It has now only ‘version’ as I use it in Multi-
   Newstatpress to monitored my 11 sites for easy update them at every plugin update
   and test that it works correctly.
 * In version 1.1.0 it will be modified:
    - the MD5 key testing has an errors and it is fixed (it needs to modify the 
      API call for people that already use it).
    - API now has more calling paramethers and two options: JSON ad HTML output.
      With the first you get the data and with the second you get the data formatted
      in HTML, so Newstatpress can use it for rendering the data via AJAX in an 
      async way.
 * Actually I’m testing the Dashboard generation via external API inside Multi-Newstatpress.
   It has some minor points to fix and then 1.1.0 can be released with the first
   important API usage.
 * Thanks
 *  Plugin Author [ice00](https://wordpress.org/support/users/ice00/)
 * (@ice00)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/api-suggestionhelp/#post-6824805)
 * I just forget: newstatpress develoup is here:
 * [https://github.com/lechab/newstatpress](https://github.com/lechab/newstatpress.git)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘API Suggestion/Help’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/newstatpress.svg)
 * [NewStatPress](https://wordpress.org/plugins/newstatpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/newstatpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/newstatpress/)
 * [Active Topics](https://wordpress.org/support/plugin/newstatpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/newstatpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/newstatpress/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [monthly](https://wordpress.org/support/topic-tag/monthly/)
 * [page](https://wordpress.org/support/topic-tag/page/)
 * [views](https://wordpress.org/support/topic-tag/views/)

 * 3 replies
 * 3 participants
 * Last reply from: [ice00](https://wordpress.org/support/users/ice00/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/api-suggestionhelp/#post-6824805)
 * Status: resolved