Aliexpress.Api 1.0.0

Aliexpress Api high level client

Install-Package Aliexpress.Api -Version 1.0.0
dotnet add package Aliexpress.Api --version 1.0.0
<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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Aliexpress.Api, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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;
    }
}

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;
    }
}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

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