NAV
Bash Javascript PHP Python Go Objective-C

Introduction to Patternchain API

Patternchain API was designed to provide users with easy access to all data and insights autonomously acquired by Patternchain.

All endpoints require a valid key as parameter. Please refer to Patternchain dashboard to retrieve the key assigned to your user.

We have language bindings in Shell, Javascript, Python, PHP, Go and Objective-C. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Get Postman Collection for easy API manipulation here.

User Level

User-level methods, including access and settings

Get Credits Remaining

Method retrieves number of credits an account has left. You might need to make verifications against this number depending on your application.

Example request:


    curl -X GET \
      https://patternchain.com/api/v1/creditsremaining \
      -H 'accept: application/json' \
      -H 'key: YOUR KEY' \
      -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/creditsremaining",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/creditsremaining", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('https://patternchain.com/api/v1/creditsremaining');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "https://patternchain.com/api/v1/creditsremaining"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://patternchain.com/api/v1/creditsremaining"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:

{
    "credits": "9"
}

HTTP Request

GET api/v1/creditsremaining

HEAD api/v1/creditsremaining

Startups

Methods to browse startups data and insights with the use of filters.

Get startups

Retrieves all companies, accepting the following filters:

Example request:


    curl 'https://patternchain.com/api/v1/companies?name=brain&yearfounded=2014' \
        -H "Accept: application/json"
        -H 'key: YOUR KEY' \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/companies?name=brain&yearfounded=2014",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/companies?name=brain&yearfounded=2014", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/companies?name=brain&yearfounded=2014');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/companies?name=brain&yearfounded=2014"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/companies?name=brain&yearfounded=2014"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:


    {
            "id": 18194,
            "company": "BrainBasket Foundation",
            "site": "brainbasket.org",
            "description": "The BrainBasket Foundation is a non-profit, non-government, professionally managed organization with undisputed reputation to focus on educational initiatives, with one single goal:\n\nTo boost the educational eco-system in Ukraine in order to produce 100,000 new software engineers by 2020\n\nWE WANT TO CHANGE UKRAINE, \nTO MAKE I.T. A DRIVING FACTOR IN CREATING A STRONG ECONOMY.\n\nWE WILL DO SO BY COLLECTING MONEY FOR COMPUTERS AND FACILITIES AND ASKING VOLUNTEERS TO HELP ORGANIZE AND TRAIN 100.000 PEOPLE BY 2020.",
            "city": "Kyiv",
            "vertical": "Non-Profit Organization",
            "CEO": null,
            "Founder": null,
            "contact_email": null,
            "logo": null,
            "facebook": "brainbasketfoundation",
            "linkedin": "not found",
            "twitter": "not found",
            "instagram": "not found",
            "Capital": 0,
            "year_founded": 2014,
            "tminusfour": 20.2288,
            "tminusthree": 18.4087,
            "tminustwo": 20.3022,
            "tminusone": 19.7453,
            "tzero": 19.8171,
            "median": 0.00168986,
            "sentiment_score": 0.279284
        }

HTTP Request

GET api/v1/companies

HEAD api/v1/companies

Get Top Startups

This endpoint retrieves the top 50 startups

Example request:


    curl "http://www.patternchain.com/api/v1/topcompanies" \
        -H "Accept: application/json" \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/topcompanies",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/topcompanies", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/topcompanies');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/topcompanies"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/topcompanies"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:

{
    "error": "Unauthenticated."
}

HTTP Request

GET api/v1/topcompanies

HEAD api/v1/topcompanies

Stocks

Methods to browse stocks data and insights with the use of filters

Get Stocks

Retrieves all stocks, accepting the following filters:

Example request:


    curl "http://www.patternchain.com/api/v1/publiccompanies?market=NYSE§or=tech" \
        -H "Accept: application/json"
        -H 'key: YOUR KEY' \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/publiccompanies?market=NYSE§or=tech",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/publiccompanies?market=NYSE§or=tech", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/publiccompanies?market=NYSE§or=tech');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/publiccompanies?market=NYSE§or=tech"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/publiccompanies?market=NYSE§or=tech"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:


        {
            "id": 122,
            "market": "NYSE",
            "ticker": "AMBR",
            "name": "Amber Road, Inc.",
            "sector": "Technology",
            "industry": "Computer Software: Prepackaged Software",
            "street": "1 MEADOWLANDS PLAZA",
            "city": "EAST RUTHERFORD",
            "state": "NJ",
            "zipcode": "07073",
            "news_name": "Amber Road"
        },
        {
            "id": 163,
            "market": "NYSE",
            "ticker": "AMN",
            "name": "AMN Healthcare Services Inc",
            "sector": "Technology",
            "industry": "Professional Services",
            "street": "245 S LOS ROBLES AVE",
            "city": "PASADENA",
            "state": "CA",
            "zipcode": "91101",
            "news_name": "AMN Healthcare"
        }

HTTP Request

GET api/v1/publiccompanies

HEAD api/v1/publiccompanies

Get 10-K Balance Sheet

Retrieves Balance Sheet from 10-K of specified ticker and fiscal year:

Example request:


    curl "http://www.patternchain.com/api/v1/balancesheet" \
        -H "Accept: application/json"
        -H 'key: YOUR KEY' \
        -H 'ticker: MSFT' \
        -H 'year: 2016' \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/balancesheet",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "ticker": "MSFT",
        "year": "2016",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/balancesheet", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/balancesheet');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY',
      'ticker' => 'MSFT',
      'year' => '2016'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/balancesheet"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("ticker", "MSFT")
        req.Header.Add("year", "2016")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"ticker": @"MSFT",
                               @"year": @"2016",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/balancesheet"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:


    {
    "data": [
        {
            "year2": "2016",
            "statement": "Balance Sheet",
            "year1": "2015"
        },
        {
            "line": "Assets",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Current assets:",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Cash and cash equivalents",
            "amountY2": 6510,
            "amountY1": 5595
        },
        {
            "line": "Short-term investments (including securities loaned ofand $75)",
            "amountY2": 106730,
            "amountY1": 90931
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total cash, cash equivalents, and short-term investments",
            "amountY2": 113240,
            "amountY1": 96526
        },
        {
            "line": "Accounts receivable, net of allowance for doubtful accounts ofand $335",
            "amountY2": 18277,
            "amountY1": 17908
        },
        {
            "line": "Inventories",
            "amountY2": 2251,
            "amountY1": 2902
        },
        {
            "line": "Other",
            "amountY2": 5892,
            "amountY1": 5461
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total current assets",
            "amountY2": 139660,
            "amountY1": 122797
        },
        {
            "line": "Property and equipment, net of accumulated depreciation of$19,800and $17,606",
            "amountY2": 18356,
            "amountY1": 14731
        },
        {
            "line": "Equity and other investments",
            "amountY2": 10431,
            "amountY1": 12053
        },
        {
            "line": "Goodwill",
            "amountY2": 17872,
            "amountY1": 16939
        },
        {
            "line": "Intangible assets, net",
            "amountY2": 3733,
            "amountY1": 4835
        },
        {
            "line": "Other long-term assets",
            "amountY2": 3642,
            "amountY1": 3117
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total assets  193,694  174,472",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Liabilities and stockholders\u0092 equity",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Current liabilities:",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Accounts payable",
            "amountY2": 6898,
            "amountY1": 6591
        },
        {
            "line": "Short-term debt",
            "amountY2": 12904,
            "amountY1": 4985
        },
        {
            "line": "Current portion of long-term debt",
            "amountY2": 0,
            "amountY1": 2499
        },
        {
            "line": "Accrued compensation",
            "amountY2": 5264,
            "amountY1": 5096
        },
        {
            "line": "Income taxes",
            "amountY2": 580,
            "amountY1": 606
        },
        {
            "line": "Short-term unearned revenue",
            "amountY2": 27468,
            "amountY1": 23223
        },
        {
            "line": "Securities lending payable",
            "amountY2": 294,
            "amountY1": 92
        },
        {
            "line": "Other",
            "amountY2": 5949,
            "amountY1": 6555
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total current liabilities",
            "amountY2": 59357,
            "amountY1": 49647
        },
        {
            "line": "Long-term debt",
            "amountY2": 40783,
            "amountY1": 27808
        },
        {
            "line": "Long-term unearned revenue",
            "amountY2": 6441,
            "amountY1": 2095
        },
        {
            "line": "Deferred income taxes",
            "amountY2": 1476,
            "amountY1": 1295
        },
        {
            "line": "Other long-term liabilities",
            "amountY2": 13640,
            "amountY1": 13544
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total liabilities",
            "amountY2": 121697,
            "amountY1": 94389
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Commitments and contingencies",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Stockholders\u0092 equity:",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Common stock and paid-in capital \u0096 shares authorized 24,000; outstandingand 8,027",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Retained earnings",
            "amountY2": 2282,
            "amountY1": 9096
        },
        {
            "line": "Accumulated other comprehensive income",
            "amountY2": 1537,
            "amountY1": 2522
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total stockholders\u0092 equity",
            "amountY2": 71997,
            "amountY1": 80083
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total liabilities and stockholders\u0092 equity",
            "amountY2": 193694,
            "amountY1": 174472
        },
        {
            "line": "",
            "amountY2": "",
            "amountY1": ""
        }
    ]
}

HTTP Request

GET api/v1/balancesheet

Get 10-K Income Statement

Retrieves Income Statement from 10-K of specified ticker and fiscal year:

Example request:


    curl "http://www.patternchain.com/api/v1/incomestatement" \
        -H "Accept: application/json"
        -H 'key: YOUR KEY' \
        -H 'ticker: MSFT' \
        -H 'year: 2016' \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/incomestatement",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "ticker": "MSFT",
        "year": "2016",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/incomestatement", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/incomestatement');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY',
      'ticker' => 'MSFT',
      'year' => '2016'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/incomestatement"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("ticker", "MSFT")
        req.Header.Add("year", "2016")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"ticker": @"MSFT",
                               @"year": @"2016",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/incomestatement"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:


{
    "data": [
        {
            "year1": "2014",
            "year2": "2015",
            "statement": "Income Statement",
            "year3": "2016"
        },
        {
            "line": "Revenue:",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Product  61,502  75,956  72,948",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Service and other",
            "amountY3": 23818,
            "amountY2": 17624,
            "amountY1": 13885
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total revenue",
            "amountY3": 85320,
            "amountY2": 93580,
            "amountY1": 86833
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Cost of revenue:",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Product",
            "amountY3": 17880,
            "amountY2": 21410,
            "amountY1": 16681
        },
        {
            "line": "Service and other",
            "amountY3": 14900,
            "amountY2": 11628,
            "amountY1": 10397
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Total cost of revenue",
            "amountY3": 32780,
            "amountY2": 33038,
            "amountY1": 27078
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Gross margin",
            "amountY3": 52540,
            "amountY2": 60542,
            "amountY1": 59755
        },
        {
            "line": "Research and development",
            "amountY3": 11988,
            "amountY2": 12046,
            "amountY1": 11381
        },
        {
            "line": "Sales and marketing",
            "amountY3": 14697,
            "amountY2": 15713,
            "amountY1": 15811
        },
        {
            "line": "General and administrative",
            "amountY3": 4563,
            "amountY2": 4611,
            "amountY1": 4677
        },
        {
            "line": "Impairment, integration, and restructuring",
            "amountY3": 1110,
            "amountY2": 10011,
            "amountY1": 127
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Operating income",
            "amountY3": 20182,
            "amountY2": 18161,
            "amountY1": 27759
        },
        {
            "line": "Other income (expense), net",
            "amountY3": -431,
            "amountY2": 346,
            "amountY1": 61
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Income before income taxes",
            "amountY3": 19751,
            "amountY2": 18507,
            "amountY1": 27820
        },
        {
            "line": "Provision for income taxes",
            "amountY3": 2953,
            "amountY2": 6314,
            "amountY1": 5746
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Net income",
            "amountY3": 16798,
            "amountY2": 12193,
            "amountY1": 22074
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Earnings per share:",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Basic",
            "amountY3": 2.12,
            "amountY2": 1.49,
            "amountY1": 2.66
        },
        {
            "line": "Diluted",
            "amountY3": 2.1,
            "amountY2": 1.48,
            "amountY1": 2.63
        },
        {
            "line": "Weighted average shares outstanding:",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Basic",
            "amountY3": 7925,
            "amountY2": 8177,
            "amountY1": 8299
        },
        {
            "line": "Diluted",
            "amountY3": 8013,
            "amountY2": 8254,
            "amountY1": 8399
        },
        {
            "line": "Cash dividends declared per common share",
            "amountY3": 1.44,
            "amountY2": 1.24,
            "amountY1": 1.12
        }
    ]
}

HTTP Request

GET api/v1/incomestatement

Get 10-K Cashflow

Retrieves Cashflow from 10-K of specified ticker and fiscal year:

Example request:


    curl "http://www.patternchain.com/api/v1/cashflow" \
        -H "Accept: application/json"
        -H 'key: YOUR KEY' \
        -H 'ticker: MSFT' \
        -H 'year: 2016' \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/cashflow",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "ticker": "MSFT",
        "year": "2016",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/cashflow", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/cashflow');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY',
      'ticker' => 'MSFT',
      'year' => '2016'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/cashflow"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("ticker", "MSFT")
        req.Header.Add("year", "2016")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"ticker": @"MSFT",
                               @"year": @"2016",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/cashflow"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:


      {
    "data": [
        {
            "year1": "2014",
            "year2": "2015",
            "statement": "Cashflow",
            "year3": "2016"
        },
        {
            "line": "Operations",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Net income     16,798   12,193   22,074",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Adjustments to reconcile net income to net cash from operations:",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Goodwill and asset impairments",
            "amountY3": 630,
            "amountY2": 7498,
            "amountY1": 0
        },
        {
            "line": "Depreciation, amortization, and other",
            "amountY3": 6622,
            "amountY2": 5957,
            "amountY1": 5212
        },
        {
            "line": "Stock-based compensation expense",
            "amountY3": 2668,
            "amountY2": 2574,
            "amountY1": 2446
        },
        {
            "line": "Net recognized gains on investments and derivatives",
            "amountY3": -223,
            "amountY2": -443,
            "amountY1": -109
        },
        {
            "line": "Deferred income taxes",
            "amountY3": 332,
            "amountY2": 224,
            "amountY1": -331
        },
        {
            "line": "Deferral of unearned revenue",
            "amountY3": 57072,
            "amountY2": 45072,
            "amountY1": 44325
        },
        {
            "line": "Recognition of unearned revenue",
            "amountY3": -48498,
            "amountY2": -44920,
            "amountY1": -41739
        },
        {
            "line": "Changes in operating assets and liabilities:",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Accounts receivable",
            "amountY3": -530,
            "amountY2": 1456,
            "amountY1": -1120
        },
        {
            "line": "Inventories",
            "amountY3": 600,
            "amountY2": -272,
            "amountY1": -161
        },
        {
            "line": "Other current assets",
            "amountY3": -1167,
            "amountY2": 62,
            "amountY1": -29
        },
        {
            "line": "Other long-term assets",
            "amountY3": -41,
            "amountY2": 346,
            "amountY1": -628
        },
        {
            "line": "Accounts payable",
            "amountY3": 88,
            "amountY2": -1054,
            "amountY1": 473
        },
        {
            "line": "Other current liabilities",
            "amountY3": -260,
            "amountY2": -624,
            "amountY1": 1075
        },
        {
            "line": "Other long-term liabilities",
            "amountY3": -766,
            "amountY2": 1599,
            "amountY1": 1014
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Net cash from operations",
            "amountY3": 33325,
            "amountY2": 29668,
            "amountY1": 32502
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Financing",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Proceeds from issuance of short-term debt, maturities of 90 days or less, net",
            "amountY3": 7195,
            "amountY2": 4481,
            "amountY1": 500
        },
        {
            "line": "Proceeds from issuance of debt",
            "amountY3": 13884,
            "amountY2": 10680,
            "amountY1": 10350
        },
        {
            "line": "Repayments of debt",
            "amountY3": -2796,
            "amountY2": -1500,
            "amountY1": -3888
        },
        {
            "line": "Common stock issued",
            "amountY3": 668,
            "amountY2": 634,
            "amountY1": 607
        },
        {
            "line": "Common stock repurchased",
            "amountY3": -15969,
            "amountY2": -14443,
            "amountY1": -7316
        },
        {
            "line": "Common stock cash dividends paid",
            "amountY3": -11006,
            "amountY2": -9882,
            "amountY1": -8879
        },
        {
            "line": "Other",
            "amountY3": -369,
            "amountY2": 362,
            "amountY1": -39
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Net cash used in financing",
            "amountY3": -8393,
            "amountY2": -9668,
            "amountY1": -8665
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Investing",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Additions to property and equipment",
            "amountY3": -8343,
            "amountY2": -5944,
            "amountY1": -5485
        },
        {
            "line": "Acquisition of companies, net of cash acquired, and purchases of intangible and other assets",
            "amountY3": -1393,
            "amountY2": -3723,
            "amountY1": -5937
        },
        {
            "line": "Purchases of investments",
            "amountY3": -129758,
            "amountY2": -98729,
            "amountY1": -72690
        },
        {
            "line": "Maturities of investments",
            "amountY3": 22054,
            "amountY2": 15013,
            "amountY1": 5272
        },
        {
            "line": "Sales of investments",
            "amountY3": 93287,
            "amountY2": 70848,
            "amountY1": 60094
        },
        {
            "line": "Securities lending payable",
            "amountY3": 203,
            "amountY2": -466,
            "amountY1": -87
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Net cash used in investing",
            "amountY3": -23950,
            "amountY2": -23001,
            "amountY1": -18833
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Effect of foreign exchange rates on cash and cash equivalents",
            "amountY3": -67,
            "amountY2": -73,
            "amountY1": -139
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Net change in cash and cash equivalents",
            "amountY3": 915,
            "amountY2": -3074,
            "amountY1": 4865
        },
        {
            "line": "Cash and cash equivalents, beginning of period",
            "amountY3": 5595,
            "amountY2": 8669,
            "amountY1": 3804
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        },
        {
            "line": "Cash and cash equivalents, end of period",
            "amountY3": 6510,
            "amountY2": 5595,
            "amountY1": 8669
        },
        {
            "line": "",
            "amountY3": "",
            "amountY2": "",
            "amountY1": ""
        }
    ]
}

HTTP Request

GET api/v1/cashflow

Get EOD (End-of-day) Information

Retrieves EOD of specified ticker between specified period

Example request:


    curl "http://www.patternchain.com/api/v1/eod" \
        -H "Accept: application/json"
        -H 'key: YOUR KEY' \
        -H 'ticker: MSFT' \
        -H 'startdate: 2017-03-21' \
        -H 'enddate: 2017-04-01' \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/eod",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "ticker": "MSFT",
        "startdate": "2017-03-21",
        "enddate": "2017-04-01",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'ticker': "MSFT",
        'startdate': "2017-03-21",
        'enddate': "2017-04-01",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/eod", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/eod');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY',
      'ticker' => 'MSFT',
      'startdate' => '2017-03-21',
      'enddate' => '2017-04-01',
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/eod"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("ticker", "MSFT")
        req.Header.Add("startdate", "2017-03-21")
        req.Header.Add("enddate", "2017-04-01")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"ticker": @"MSFT",
                               @"startdate": @"2017-03-21",
                               @"enddate": @"2017-04-01",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/eod"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:


    {
    "data": [
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-21",
            "open": "65.190000",
            "high": "65.500000",
            "low": "64.130000",
            "close": "64.210000",
            "volume": 26640480
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-22",
            "open": "64.120000",
            "high": "65.140000",
            "low": "64.120000",
            "close": "65.030000",
            "volume": 20680015
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-23",
            "open": "64.940000",
            "high": "65.235000",
            "low": "64.765000",
            "close": "64.870000",
            "volume": 19269203
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-24",
            "open": "65.357500",
            "high": "65.450000",
            "low": "64.760000",
            "close": "64.980000",
            "volume": 22617105
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-27",
            "open": "64.630000",
            "high": "65.220000",
            "low": "64.350000",
            "close": "65.100000",
            "volume": 18614662
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-28",
            "open": "64.960000",
            "high": "65.470000",
            "low": "64.650000",
            "close": "65.290000",
            "volume": 20080358
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-29",
            "open": "65.120000",
            "high": "65.500000",
            "low": "64.947500",
            "close": "65.470000",
            "volume": 13618424
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-30",
            "open": "65.420000",
            "high": "65.980000",
            "low": "65.360000",
            "close": "65.710000",
            "volume": 15122823
        },
        {
            "stock_id": 5388,
            "ticker": "MSFT",
            "date": "2017-03-31",
            "open": "65.650000",
            "high": "66.190000",
            "low": "65.450000",
            "close": "65.860000",
            "volume": 21040331
        }
    ],
    "type": "member"
}

HTTP Request

GET api/v1/eod

Get News

Retrieves all relevant news, taking ticker or name as parameter

Example request:


    curl "http://www.patternchain.com/api/v1/news/MSFT" \
        -H "Accept: application/json"
        -H 'key: YOUR KEY' \
        -H 'cache-control: no-cache'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://www.patternchain.com/api/v1/news/MSFT",
    "method": "GET",
    "headers": {
        "key": "YOUR KEY",
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

    import http.client

    conn = http.client.HTTPSConnection("patternchain.com")

    headers = {
        'key': "YOUR KEY",
        'accept': "application/json",
        'cache-control': "no-cache"
        }

    conn.request("GET", "/api/v1/news/MSFT", headers=headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))

    setUrl('http://www.patternchain.com/api/v1/news/MSFT');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'accept' => 'application/json',
      'key' => 'YOUR KEY'
    ));

    try {
      $response = $request->send();

      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    package main

    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )

    func main() {

        url := "http://www.patternchain.com/api/v1/news/MSFT"

        req, _ := http.NewRequest("GET", url, nil)

        req.Header.Add("key", "YOUR KEY")
        req.Header.Add("accept", "application/json")
        req.Header.Add("cache-control", "no-cache")

        res, _ := http.DefaultClient.Do(req)

        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)

        fmt.Println(res)
        fmt.Println(string(body))

    }

    #import 

    NSDictionary *headers = @{ @"key": @"YOUR KEY",
                               @"accept": @"application/json",
                               @"cache-control": @"no-cache"};

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.patternchain.com/api/v1/news/MSFT"]
                                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                       timeoutInterval:10.0];
    [request setHTTPMethod:@"GET"];
    [request setAllHTTPHeaderFields:headers];

    NSURLSession *session = [NSURLSession sharedSession];
    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        NSLog(@"%@", error);
                                                    } else {
                                                        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                        NSLog(@"%@", httpResponse);
                                                    }
                                                }];
    [dataTask resume];

Example response:


        {
            "ticker": "MSFT",
            "datetime": "2017-05-02 22:06:39",
            "article_url": "http://www.chicagotribune.com/bluesky/technology/ct-microsoft-surface-laptop-blm-bsi-20170502-story.html",
            "title": "Microsoft presents $999 laptop in hardware push to college kids",
            "author": "Mark Gurman,",
            "rec": null,
            "sentiment": null,
            "created_date": "2017-05-02 22:18:51",
            "domain": "chicagotribune.com",
            "paragraph": "Microsoft has already cracked the professional and creative markets with inventive tablets and a desktop that turns into a virtual drafting table.|\nNow it's chasing another category many believe is Apple's to lose: the $1,000 laptop for everyone.",
            "type": 0
        },
        {
            "ticker": "MSFT",
            "datetime": "2017-05-06 22:21:44",
            "article_url": "http://www.dailyherald.com/business/20170506/microsoft-wants-its-products-in-your-kidsx2019-classrooms",
            "title": "Microsoft wants its products in your kids' classrooms",
            "author": null,
            "rec": null,
            "sentiment": null,
            "created_date": "2017-05-06 22:27:55",
            "domain": "dailyherald.com",
            "paragraph": "\"Talent is everywhere. Opportunity is not,\" said Microsoft chief executive Satya Nadella, who opened the presentation with a personal story about how his great-grandfather's education paved the way for his own success.",
            "type": 0
        }

HTTP Request

GET api/v1/news

HEAD api/v1/news

Errors

Patternchain uses the following error codes:

Error Code Meaning
201 Insufficient Credits
400 Bad Request – Your request is incorrect
401 Unauthorized – Access token is invalid
403 Forbidden - No privileges to access endpoint
404 Not Found – Endpoint could not be found
405 Method Not Allowed – You tried to access an invalid method
406 Not Acceptable – You requested an unrecognizable format
429 Too Many Requests
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.