• 0
Sign in to follow this  
carlosipe

Listing only active items

Question

Hey, 

 

I have around 30.000 products published on MLA and I need to query the api to get the active items.

But if I GET https://api.mercadolibre.com/sites/MLA/search?seller_id=198131508I get also items where status is 'closed'. How can I filter the query to get ONLY active items? I cannot find any filter on API documentation.

 

I have around 30.000 active items and (for now) around 20.000 closed items, so it's not possible to query each item status by getting https://api.mercadolibre.com/items/ITEM_ID. 50.000 queries would be too much expensive.

 

Could you give me any insight on how to solve it? Or a workaround if not possible?

 

Thank you so much,

 

Cheers,

 

CarlosIPe

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hello CarlosIPe,

 

You need put in parameters: 'status'=>'active'

 

$listings = $meli -> get('/users/' . $user_id . '/items/search', array('status'=>'active', 'seller' => $user_id, 'access_token' => $access_token));
echo 'listings: --------------------------<br>';
print_r($listings['body']->results);
 
in page http://developers.mercadolibre.com/search-filtering/ don't have this explanation, but in the deep this forum you can to find.
 
Best Regards,
Rodrigo

Share this post


Link to post
Share on other sites
  • 0

Actually it didn't work. I'm following your advice of using status=active as a parameter.

I'm using a test user that has 12 closed items.

 

If I GET https://api.mercadolibre.com/sites/MLA/search?status=active&seller_id=198131508

 

it returns:

 

 

{
   "site_id": "MLA",
   "seller": {
   "id": 198131508,
...

},
   "real_estate_agency": false,
   "car_dealer": false,
   "tags": [
   ]

}
,
"paging": {
"total": 12,
"offset": 0,
"limit": 50

}
,
"results": [
   - {
      "id": "MLA590357942",

     ...

    }

  - {

     "id": "MLA590357948",

     ...

 
If I get https://api.mercadolibre.com/items/MLA590357942  it says status = closed. But it still appears on my search query.
 
Any idea? Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this