Package: restocks-api-wrapper
Restocks.net API WrapperOverviewTherestocks_api_wrapperis anunofficialwrapper for the api of the sneaker platform restocks.net. It allows you to get information about products, but also to manage your sales. There is no connection to restocks, this is a private project.InstallationInstall the package using pip:pipinstallrestocks-api-wrapperEnsure that you are using Python 3.11 or higher, as this is the minimum version required for this package.FunctionsThe following table describes each function available in the RestocksClient object, along with whether a user login is required to use the function.Function NameDescriptionLogin Requiredsearch_productSearches for a product by SKU or name.Noget_product_infoRetrieves detailed information about a product.Noget_size_idFetches the size ID for a given product and size.Noget_sku_from_idRetrieves the SKU for a product based on its ID.Noget_payoutCalculates the expected payout for a listing.NologinAuthenticates the user with email and password.Nocheck_loginChecks if the user is logged in.Yesget_current_listingsRetrieves current product listings.Yesget_history_salesFetches historical sales data.Yesget_current_salesFetches current sales data.Yesedit_listingEdits the price of an existing listing.Yesdelete_listingDeletes an existing listing.Yeslist_productLists a new product for sale.Yesget_shipping_productsRetrieves products that need shipping.Yesdownload_labelDownloads the shipping label for a product.Yescheck_consign_statusChecks the consignment status of the user.YesFiltersWhen listing a product or retrieving current listings, you can specify filters to narrow down the results or to set the conditions of your listing. Below are the filter types and their possible values:ListingDurationThis filter is used to specify the duration for which a product will be listed on the platform. The possible values are:Days30: List the product for 30 days.Days60: List the product for 60 days.Days90: List the product for 90 days.SellMethodThis filter is used to define the method of sale. The possible values are:Consign: The product is sold on consignment.Resell: The product is resold directly.Refer to the usage example below to see how these filters are applied in method calls.Usage Examplefromrestocks_client.clientimportRestocksClientfromrestocks_client.filtersimportSellMethod,ListingDuration# Initialize the RestocksClient with login credentials and proxy list.client=RestocksClient(proxy_list=["proxy1:port:username:password","proxy2:port:username:password",# ... (Add more proxies as needed)])# Fetch information about a product using its SKU.product_info=client.get_product_info(slug=client.search_product(sku='DD1391-100').slug)# login dataemail='your_email@example.com',password='your_password',# Authenticate and login.client.login(email,password)# Retrieve current listings with a specific sell method.current_listings=client.get_current_listings(sell_method=SellMethod.Resell)# List a product for sale on the platform.client.list_product(product=client.search_product(sku='DD1391-100'),size='36',sell_method=SellMethod.Resell,duration=ListingDuration.Days90,store_price=900)# Example of working with listings.listing=current_listings[1]client.edit_listing(listing_id=listing.listing_id,new_price=500)forlistingincurrent_listings:client.delete_listing(listing.listing_id)NoteI recommend the use of proxies, which can be specified as a list as shown in the example. The formathostname:port:username:passwordis used for this. The use of proxies helps to avoid blocks of restocks. If no proxy list is given, the localhost is used by default.CreditsThis project was inspired by the structure ofssbanjo's Restocks-client. Whilerestocks_api_wrapperis a completely independent and updated implementation, the design and workflow provided a starting point for development. Many thanks to the original author for their work.