Aliexpress.Api 1.0.0

dotnet add package Aliexpress.Api --version 1.0.0                
NuGet\Install-Package Aliexpress.Api -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aliexpress.Api" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Aliexpress.Api --version 1.0.0                
#r "nuget: Aliexpress.Api, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Aliexpress.Api as a Cake Addin
#addin nuget:?package=Aliexpress.Api&version=1.0.0

// Install Aliexpress.Api as a Cake Tool
#tool nuget:?package=Aliexpress.Api&version=1.0.0                

Aliexpress.Api

Aliexpress Api high level client written on C#

About

  • Build on Asp.net core 2.0
  • Wraps all results into strong-typed models
  • Parses API exceptions
  • Tests included
  • Service Collection extension for easy integration

Getting started

To add client into dependency injection services:

public void ConfigureServices(IServiceCollection services)
{
    services.AddAliClient(settings =>
    {
        settings.AppKey = "YOURAPPKEY";
    });
}

Then client will be injected, for example simple MVC Controller:

[Route("api/[controller]")]
public class AliController : Controller
{
    private readonly IAliexpressApiClient _aliClient;

    public AliController(IAliexpressApiClient aliClient)
    {
        _logger = logger;
        _aliClient = aliClient;
    }

    [HttpGet]
    public async Task<IActionResult> Get(string keywords)
    {
        var items = await _aliClient.ListPromotionProduct(new ListPromotionProductParameters
        {
            Keywords = keywords
        });

        return Json(items);
    }
}

Original Aliexpress API documentation is Here

Note: You need to register at https://portals.aliexpress.com

Tests

To setup tests - please edit settings.json file and paste your App key, tracking and signature ids there.

How to create actual Promotion urls using raw product url?

Here is the harsh example of what you need to do.

// Get some products
var items = await _aliClient.ListPromotionProduct(new ListPromotionProductParameters
{
    Keywords = keywords
});

// Create comma-separated list of urls
var urlsList = items.Products.Select(p => p.ProductUrl);
var urls = string.Join(",", urlsList);

// Get promotions urls by list of urls
var processed = await _aliClient.GetPromotionLinks(new GetPromotionLinksParameters
{
    TrackingId = "YOURTRACKINGID",
    Urls = urls
});

// Get promotion url and paste it in your original results
foreach(var i in items.Products)
{
    var trueUrl = processed.PromotionUrls.SingleOrDefault(u => u.Url == i.ProductUrl);

    if(trueUrl != null)
    {
        i.ProductUrl = trueUrl.PromotionUrl;
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 1,688 4/20/2018