Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
C# .NET client libraries for the CityIndex TradingAPI
C# JavaScript CSS Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
tools
.gitignore
DEV_SETUP.txt
LICENSE.txt
NOTICES.txt
README.markdown
build.cmd

README.markdown

CIAPI.CS CompleteSupported

A complete .NET client library for connecting to the CityIndex Trading API.

Includes builds for:

  • .NET 4
  • .NET 3.5
  • Silverlight
  • Windows Phone 7

and is distributed via NuGet.

Status

Covers the complete API, and is actively being developed and supported

Usage

//Setup a connection to the rpc endpoint
var rpcClient = new Client(new Uri("https://{REST api url}"));
//Create a session
rpcClient.LogIn("{username}", "{password});
//Retrieve some data
var priceBars = rpcClient.PriceHistory.GetPriceBars({marketId}, "MINUTE", 10, "10");

//Setup a connection to the streaming endpoint
var streamingClient = StreamingClientFactory
      .CreateStreamingClient(new Uri("https://{streaming api url}"), "{username}", rpcClient.Session);
//Subscribe to a stream
var priceListener = streamingClient.BuildPricesListener({marketId});
priceListener.MessageReceived += (s, message) => { Console.Write(message.Data.ToString()) };

//When done, disconnect and clean up
streamingClient.TearDownListener(priceListener);
streamingClient.Dispose();
rpcClient.LogOut();
rpcClient.Dispose();

See the Integration tests for further examples

Copyright and license

This library is opensource and licensed under the Apache v2 license

Note that in order to connect to the CityIndex Trading API you must be a CityIndex client and abide by the CityIndex terms and conditions related to usage of your account.

Getting started

Compiled versions of CIAPI.CS are distributed via NuGet.org. You must be running NuGet v1.6+.

To install the latest stable version, search for CIAPI.CS in the NuGet VS2010 GUI, or run:

Install-Package CIAPI.CS

From the NuGet Console in VS2010.

You can also install a pre-release "bleedingedge" version:

Install-Package CIAPI.CS

Versioning numbers follow the SemVer standard.

See the Integration tests for examples on how to use the library.

Support

Refer to the CIAPI.docs for an overview of the available API methods and what each of them do.

If you get stuck, search faq.labs.cityindex.com for help.
If you are still stuck, post a new FAQ question; tagging it ciapi.cs.

Use the GitHub issue tracker to report bugs and make feature requests.

NB! Bugs reported without attached test cases (preferably as unit tests) will not be investigated

We welcome patches - please fork the project & submit a pull request.

Building from source

  • Clone this repo
  • Refer to DEV_SETUP.txt for pre-reqs
  • Open src/{desired platform}.sln in VS2010
  • Run build.cmd to compile, run all tests and package
Something went wrong with that request. Please try again.