Get seller items count by various criteria - api

I want to retrieve the total number of items of a seller, by various aspects like number of all items, number of active items, number of sold items, number of returned items, etc. I just need the count, not the complete item details. Couldn't find any good API for that.
GetMyeBaySelling does return the items by various aspects but it returns the complete item details. I can't find any option to 'exclude' item details from the results, so that only pagination is returned that gives the total count.
What other method in the eBay API can I use to achieve this purpose?

In order to get the number of items only you can add an OutputSelector to the GetMyeBaySelling call. For you purpose <OutputSelector>TotalNumberOfEntries</OutputSelector> would be sufficient. But you are able to add more OutputSelectors according to your needs. For most of the eBay Trading API calls the OutputSelector field is available.
I've created an example for the GetMyeBaySelling call in our API playground with the OutputSelectors "TotalNumberOfEntries" and "Summary". Feel free to modify the call and see the result directly in the response area. For example if you don't need the Summary just remove the field from the request.

Related

Is there an API call to list all available product id's (ID's alone) in Shopify?

I use POSTMAN GUI for retrieving a list of items from Shopify API.
I would like to know if there exists a way to get available product id's alone, preferably as a list of values over a single api GET call. The one I know of is
/admin/api/2022-04/products.json
It returns a list of all product information, and looping over them/traversing the json is not very efficient. I hope there must be an easy way to fetch all ID's alone in one go. Should there be not?
You can add /admin/api/2022-04/products.json?fields=id to the end of your request to limit the output only for a single field or multiply.
Please note that if you have more than 250 products you will need to make more than one request, since the request is limited to 250 products.
You can make one call to the Admin API for all your product IDs using the Bulk Query. That will result in you receiving a URL where you download a file in JSONL format with every single product ID in your store, without the paging or limits of other approaches.

How to get a list of products by ItemID Ebay SDK

I would like to get a list of products filtered by their ItemID ?
I successfully retrieved a list of products filtered by date using the GetSellerList Call on Ebay SDK.
I saw there is a kind of getItem method but it seems to return only one item. Is there a way to do it without calling multiple times the getItem API method ?
https://developer.ebay.com/DevZone/shopping/docs/CallRef/GetMultipleItems.html
I think You are looking for GetMultipleItems() method from ebaysdk.shopping as above.
You can retrieve maximum 20 items per one query.

Can podio's api filter item response with only a mini detail level for each item?

My script needs to check from time to time that all items present in an app are recorded in its own db. Indeed even when using the podio hooks, it happens that my script and podio are getting desynchronised.
It uses the filter item api call by batch of 100 of items. In this case the script doesn't need to know all the fields values, but only the basic informations: item_id, app, title, link and current_revision.
I wonder if it's possible to set a query parameter in the filter function only only get the mini view of each item. This could improve greatly performances.
You can use fields parameter for that.
More details on how it works and how else it could be used are right here: https://developers.podio.com/index/api in "Bundling responses using fields parameter" section.
Using fields to bundle objects can be a way to drastically reduce the amount of API requests you have to make.
Most likely you are looking for fields=items.view(micro) parameter. Podio API will return then only 5 values for each item:
app_item_id
item_id
title
link
revision

How to get /admin/products.json in a chronological order?

I need to be able to poll more than 250 products from the Shopify API. In order to do so, I need to retrieve the products from the API in a chronological order, with the oldest products first. Once I have the first 250 items, I retrieve another 250 items filtered by max_created_at.
I noticed that: GET /admin/products.json returns the products in a random order, but GET /admin/products.json?since_id=0 returns the products in a chronological order. Is this the intended behaviour? Or is there a flag that I can send with GET /admin/products.json to specify the sorting order?
Edit: I guess my question boils down to this: Is there a field that I can set that the results returned by the Shopify API will be ordered by?
Maybe the API has been updated since the last post but now you can do that like that :
https://yourshop.myshopift.com/admin/products.json?limit=50&fields=id,images,title&order=created_at+desc
Just add the query string parameter order=created_at+asc
This is an undocumented feature but it seems to work for most fields.
This is unintended behaviour, reliable sort orders for Product are limited to title and total, and then filtering options are as listed in the API docs.

How to get item in REST API by multiple item id

I have product_id and onec_id columns to get items from DB. Which API routes should I use to get items by product_id or by onec_id?
Is it right for REST routes?
GET /products/{product_id}
GET /products/get_by_onec_id/{onec_id}
The most REST solution is to fire one HTTP request for each id. For example
GET /product/736
REST is intended to represent the state of a resource. It can return a set of items, but only if these items relate to each other in some way. For example
GET /onec/492/products
Will return the set of products associated with the specified onec.
If you want to return the set of products identified by a set of IDs in a single request, you may have your shortcut syntax like
GET /products/12,768,56,086
But it's not really common because it's quite a departure from the REST objectives
To get a single Product or Onec(?), GET
/products/{id}
/onecs/{id}