578 posts
  • Attended a Community Meetup
  • Australia
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Exclusive Author
  • Has been a member for 7-8 years
  • Referred between 1 and 9 users
+1 more
ryan says

Hi everyone!

OK, well, I guess I better introduce you all to the Marketplace API .

The purpose of the API is to enable third party developers (that’s you!) to develop applications using real-time, individualised marketplace data, in a manner that doesn’t require users to compromise their accounts.

Fwoar, that’s a mouthful. So what does that mean?

Every Account now has an API Key.

The API key (which you can find by clicking on ‘Account’, then ‘Edit’ and expanding the ‘API Key’ thing), is a long, long, long and random, long password-like key. It’s what users can provide as an alternative to their password to access API data.

Users can regenerate their API key, but they can’t make up their own (we make up one with the power of computers).

The API provides various ‘sets’ of data in either JSON or XML .

We figured developers would either prefer JSON or XML , so we support these two formats. If you’re a JS or AS developer and don’t know what JSON is, it’s data that is returned as a Object Literal or a Hash. This means you can eval() the response and access it like a Hash or Object and not have to do any parsing of XML . How cool is that!

Sets of data are not locked down, and we expect to collaborate with the community on what kind of data you’d want to work with. We’ll provide some initial sets, some suggestions and go from there. This is a topic for another thread, so more on that later.

The API is ‘versioned’.

We’ve the ability to ‘version’ our API , so you’ll be able to write an application to a particular version, and be able to sleep at night knowing that it wont break 12 months down the track.

How we’re going to manage this is again, a topic for another thread, which I’ll write in like, soon!

A quick example.

The API is provided over HTTP , so it’s very easy to test and work with. The format of the API URL is the following:

http://marketplace.envato.com/api/version/username/api-key/set.format

Version the the version label, there will eventually be version 1, version 2, etc. There’ll always be an ‘edge’ version that we chop and change every so often (with the community’s feedback, of course!), and eventually freeze as a new version.

Username and API key are pretty straight forward :)

The set is the label of the particular data set you want back, and format is what data format you’d like it back in (either json or xml), so let’s have a look at my account’s vitals shall we?

Example

That is a real, working API url. You can click it, and you’ll see the JSON response in the browser. Here it is in XML format:

Example

Neat huh? Now its’ OK. I don’t mind if you can see my balance :) The API is perfectly safe and separate to the account log in process, and I’m not a real author so I have no secrets to keep :P

Here’s another example of a set (that has an array):

Example

As you can see, I’ve made a few sales of my controversial song, ‘The Clinton is a Clintonhead Song’.

Combining Sets to reduce HTTP roundtrips.

One of the coolest features of our API is the arbitrary combination of sets to reduce HTTP roundtrips. We expect we might have 30 sets of data you can ask for, and you can ask for them all in one go! We’ve only got ‘vitals’ and ‘recent-sales’ deployed right now, so lets combine them and see what we get:

Example

As you can see, we combine them with a +. And as you can see in the result, you’ve got both sets of data back in that one object literal! The same thing in XML :

Example

Where to from here?

We’ll pre-empt you and add a few more sets of data, then create another thread asking for feedback and make some suggestions of other bits of data you might want.

We’ll also start a thread documenting how you should handle errors that the API may send back to you.

So there you go! Stay tuned for the next round!

7 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
dirt_burger says

What is an API ?

165 posts Hello World!
  • Microlancer Beta Tester
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • China
  • Has been a member for 7-8 years
  • Author had a File in an Envato Bundle
  • Exclusive Author
+2 more
shuhankuang says

Cool!

366 posts WordPress Guy
  • Envato Staff
  • Australia
  • Has been a member for 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Reviewer
+1 more
Japh Staff says

Great work, Ryan! I’m really looking forward to having a play around with this and seeing what can be done…

Thanks! :)

burningstonecold
burningstonecold Recent Posts
Threads Started
143 posts
  • Australia
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 and 100 dollars
  • Won a Competition
burningstonecold says

Excellent work Ryan and the Envato Dev team!

Would eventually be good to see a documentation site on the API .

23 posts
  • Has been a member for 5-6 years
  • Exclusive Author
  • Referred between 1 and 9 users
  • Finland
  • Sold between 1 000 and 5 000 dollars
  • Bought between 1 and 9 items
Lahdekorpi says

Uuh, I can’t wait to get developing :)

23 posts
  • Has been a member for 5-6 years
  • Exclusive Author
  • Referred between 1 and 9 users
  • Finland
  • Sold between 1 000 and 5 000 dollars
  • Bought between 1 and 9 items
Lahdekorpi says

Is this still disabled, mine just outputs “not_authenticated Username and/or API Key invalid.” when using my username and the generated API (tried regenerating it too)?

23 posts
  • Has been a member for 5-6 years
  • Exclusive Author
  • Referred between 1 and 9 users
  • Finland
  • Sold between 1 000 and 5 000 dollars
  • Bought between 1 and 9 items
Lahdekorpi says

Hmm, and now it works with the same url, oh well…

492 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • India
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
avenue28 says

This is really awesome. Can’t wait to see all the data sets! :)

308 posts
  • Beta Tester
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Referred between 1 and 9 users
  • Sold between 100 and 1 000 dollars
  • United States
BrianCoyDesign says

when I click on the links it tries to download a file instead of show me the example in IE 7 .

by
by
by
by
by
by