2821 posts
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+10 more
dtbaker Volunteer 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
  • Microlancer Beta Tester
  • Most Wanted Bounty Winner
  • Has been a member for 2-3 years
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • Exclusive Author
  • Australia
StaticNova says

Wooh, thanks for this!

2821 posts
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+10 more
dtbaker Volunteer 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:

3249 posts Nice Guy
  • Forum Superstar
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 6-7 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Won a Competition
  • Bought between 100 and 499 items
  • Exclusive Author
+6 more
RubenBristian 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');
2821 posts
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+10 more
dtbaker Volunteer 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.

3249 posts Nice Guy
  • Forum Superstar
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 6-7 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Won a Competition
  • Bought between 100 and 499 items
  • Exclusive Author
+6 more
RubenBristian 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..

964 posts It's in the pipeline!
  • Elite Author
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Exclusive Author
  • Microlancer Beta Tester
  • Author had a Free File of the Month
+2 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
2001 posts
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 4-5 years
  • Austria
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Microlancer Beta Tester
+3 more
revaxarts says

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

I like RubenBristian’s approach

3117 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
  • Exclusive Author
chrisakelley 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:

2001 posts
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 4-5 years
  • Austria
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Microlancer Beta Tester
+3 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