3094 posts
  • Located in Australia
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
  • Helped several times protecting Envato Market against copyright violations
+16 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!

3094 posts
  • Located in Australia
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
  • Helped several times protecting Envato Market against copyright violations
+16 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:

3556 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,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');
3094 posts
  • Located in Australia
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
  • Helped several times protecting Envato Market against copyright violations
+16 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.

3556 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,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..

1012 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • 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
2028 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Provided great feedback to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+9 more
revaxarts says

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

I like RubenBristian’s approach

3243 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:

2028 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Provided great feedback to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+9 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!

by
by
by
by
by
by