3319 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Hello everybody,

Here is the PHP script I use to download my monthly Envato CSV Statements for in-house processing. You could use this to:

  • graph your item sales
  • automatically calculate split earnings on collaboration items
  • anything else that isn’t possible with the current earnings API

This script works by first logging into the marketplace using your Envato username/password. It then downloads a copy of your CSV statements into a temporary folder. It will only download the CSV statements once and cache them for future requests (except the most recent statement, which it grabs new each time).

Example usage:

require_once 'class.envato_scraper.php';
$my_scraper = new envato_scraper();
$my_scraper->do_login('username','password');
$statement = $my_scraper->get_statement('1/2013'); // get csv from Jan 2013 to now.
print_r($statement);

Example output:

Array
(
    [0] => Array
        (
            [type] => sale
            [date] => 2013-01-31 23:43:06 +1100
            [time] => 1359636186
            [item] => WordPress Email Ticket Support Plugin
            [item_id] => 254823
            [envato_item_id] => 0
            [earnt] => 15.40
            [amount] => 22.00
            [rate] => 70.0
        )

    [1] => Array
        (
            [type] => sale
            [date] => 2013-01-31 22:16:25 +1100
            [time] => 1359630985
            [item] => PHP Search Engine
            [item_id] => 89499
            [envato_item_id] => 0
            [earnt] => 7.00
            [amount] => 10.00
            [rate] => 70.0
        )
etc....

Place this script on a web server somewhere (probably best a local web server). The first time you run this script please run it from a web browser, because it will probably ask you for a re-captch code (yes, it handles re-captcha on the envato login screen! cool ey!) after that first run and captcha code you should be right to automate the script from a cron job or similar.

Code here, feel free to fork and modify: https://github.com/dtbaker/envato-scraper

I look forward to seeing some new cool interesting apps made with this scraper/API, please share your creations back with the community here :)

Cheerio, Dave

24 posts
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Won a Most Wanted contest
+3 more
StaticNova says

Wooh, thanks for this!

3319 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Commission Split Calculator

And here is the basic Envato Commission Split Calculator script.

I’m using this on one of my items so both myself and the other author can get up to date commission split information.

https://github.com/dtbaker/envato-scraper/blob/master/commission-split.php

So I send a special URL to the other author and they can see up to date sales and commission information on the joint item, example:

3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

This looks really good! Thanks for sharing, will definitely give it a try! :)

However, i have a concern.. Is this safe?

define('_ENVATO_PASSWORD','your_envato_password');
3319 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Is this safe?
define('_ENVATO_PASSWORD','your_envato_password');

certainly not safe at all :) but there are things that are not possible with the current API, so the only way I can automate them is using my account password and a script like this.

3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says


Is this safe?
define('_ENVATO_PASSWORD','your_envato_password');
certainly not safe at all :) but there are things that are not possible with the current API, so the only way I can automate them is using my account password and a script like this.

:)

yeah i know that the API could be improved a lot. I’ve requested this feature(detailed earnings per file per month) some time ago specifically for this reason..

1058 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
+7 more
purethemes says
Awesome! I was about to do something like this (not the scraper but the spliter from csv files). I tried to use this but I’ve got error. I’ve just changed login and password in example.php (I’ve double checked and it is correct) and all I get is
failed. no auth token found on pagefailed. no auth token found on pageUnable to login. Sorry, please try again shortly.failed, probably not logged in correctly, invalid month or envato is temporarily down.
M
2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says

Great one Dave! I’m just thinking about an implementaion in the Statementer somehow.

I like RubenBristian’s approach

3437 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says

This looks really good! Thanks for sharing, will definitely give it a try! :)

However, i have a concern.. Is this safe?

define('_ENVATO_PASSWORD','your_envato_password');

just run it on a local install :bigsmile:

2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says

I’ve added a beta version of the Statementer to the Dashboard plus which supports percentage earnings

\\

Please disable the stable one if you would like to test it!

Let me know what you think!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by