Latest 0.1.0
License MIT
Platforms ios 6.0, osx 10.8, requires ARC
Dependencies AFNetworking, ReactiveCocoa, ISO8601DateFormatter, Mantle

Treasure Data REST API Client for Objective-C

Build Status Gitter chat

Objective-C Client Library for Treasure Data REST API, built using AFNetworking, Mantle, and ReactiveCocoa.


Installation with CocoaPods


platform :ios, '7.0'
pod "TreasureData", "~> 0.1.0"


Each request method on TRDClient returns a ReactiveCocoa signal.


Treasure Data REST API uses API key for authentication key. See API document.

You can create a client with api key directly.

TRDApiKey *apiKey = [TRDApiKey apiKeyWithValue:@"TD_API_KEY"];
TRDClient *client = [[TRDClient alloc] initWithApiKey:apiKey];

If you want to authenticate with email & password, authenticateWithUsername:password can be used.

[[TRDCLient authenticateWithUsername:@"email" password:@"pass"] subscribeNext:^(TRDClient *client) {
    NSLog("apiKey: %@" client.apiKey.value);

Receiving result


It often makes sense to handle each result object independently, so you can spread any processing out instead of doing it all at once:

RACSingal *request = [cleint fetchAllDatabases];
[request subscribeNext:^(TRDDatabaes *database) {
    // This block is invoked for _each_ result received, so you can deal with
    // them one-by-one as they arrive.
} error:^(NSError *error) {
    // Invoked when an error occurs.
    // Your `next` and `completed` blocks won't be invoked after this point.
} completed:^{
    // Invoked when the request completes and we've received/processed all the
    // results.
    // Your `next` and `error` blocks won't be invoked after this point.

all result at once

If you can’t do anything until you have all of the results, you can collect them into a single array:

RACSingal *request = [cleint fetchAllDatabases];
[[request collect] subscribeNext:^(NSArray *databases) {
    // Thanks to -collect, this block is invoked after the request completes,
    // with _all_ the results that were received.
} error:^(NSError *error) {
    // Invoked when an error occurs. You won't receive any results if this
    // happens.


MIT license.

Latest podspec

    "name": "TreasureData",
    "version": "0.1.0",
    "summary": "Treasure Data Client Library for Objective-C.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Kenichi Yonekawa": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "source_files": "TreasureData/**/*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "6.0",
        "osx": "10.8"
    "dependencies": {
        "AFNetworking": [
        "ReactiveCocoa": [
        "ISO8601DateFormatter": [
        "Mantle": [

Pin It on Pinterest

Share This