Company API

API change history

A collection of RESTful methods that returns various financial data for a requested company including balance sheets, stock quotes , company look-up utilities and more.

Historical Stock Prices

Returns up to 10 years of historical price quotes in a monthly interval for a given company.

Try it

Request

Request URL

Request parameters

  • string

    Publicly traded company's stock symbol

Request headers

  • string
    Subscription key which provides access to this API. Found in your Profile.

Request body

Responses

200 OK

A name-value collection of pricing data

Representations

{
   "2016-01-04T00:00:00":52.169998,
   "2015-12-01T00:00:00":55.48,
   "2015-11-02T00:00:00":54.349998,
   "2015-10-01T00:00:00":52.287563,
   "2015-09-01T00:00:00":43.963669,
   "2015-08-03T00:00:00":43.228626,
   "2015-07-01T00:00:00":46.083443,
   "2015-06-01T00:00:00":43.567112,
   "2015-05-01T00:00:00":46.241333,
   "2015-04-01T00:00:00":47.687908,
   "2015-03-02T00:00:00":39.864113,
   "2015-02-02T00:00:00":42.991669,
   "2015-01-02T00:00:00":39.329311,
   "2014-12-01T00:00:00":45.218975,
   "2014-11-03T00:00:00":46.542931,
   "2014-10-01T00:00:00":45.41925,
   "2014-09-02T00:00:00":44.848488,
   "2014-08-01T00:00:00":43.948811,
   "2014-07-01T00:00:00":41.493656,
   "2014-06-02T00:00:00":40.090027,
   "2014-05-01T00:00:00":39.359367,
   "2014-04-01T00:00:00":38.568134,
   "2014-03-03T00:00:00":39.131382,
   "2014-02-03T00:00:00":36.572899,
   "2014-01-02T00:00:00":35.855343,
   "2013-12-02T00:00:00":35.447895,
   "2013-11-01T00:00:00":36.130135,
   "2013-10-01T00:00:00":33.300247,
   "2013-09-03T00:00:00":31.297152,
   "2013-08-01T00:00:00":31.410004,
   "2013-07-01T00:00:00":29.733431,
   "2013-06-03T00:00:00":32.254795,
   "2013-05-01T00:00:00":32.590981,
   "2013-04-01T00:00:00":30.694828,
   "2013-03-01T00:00:00":26.53109,
   "2013-02-01T00:00:00":25.779945,
   "2013-01-02T00:00:00":25.246357,
   "2012-12-03T00:00:00":24.565762,
   "2012-11-01T00:00:00":24.482988,
   "2012-10-01T00:00:00":26.03492,
   "2012-09-04T00:00:00":27.147835,
   "2012-08-01T00:00:00":28.114794,
   "2012-07-02T00:00:00":26.706366,
   "2012-06-01T00:00:00":27.721334,
   "2012-05-01T00:00:00":26.452623,
   "2012-04-02T00:00:00":28.828074,
   "2012-03-01T00:00:00":29.044146,
   "2012-02-01T00:00:00":28.575985,
   "2012-01-03T00:00:00":26.412409,
   "2011-12-01T00:00:00":23.219305,
   "2011-11-01T00:00:00":22.879425,
   "2011-10-03T00:00:00":23.640556,
   "2011-09-01T00:00:00":22.095886,
   "2011-08-01T00:00:00":23.613924,
   "2011-07-01T00:00:00":24.171555,
   "2011-06-01T00:00:00":22.936512,
   "2011-05-02T00:00:00":22.06316,
   "2011-04-01T00:00:00":22.717035,
   "2011-03-01T00:00:00":22.252527,
   "2011-02-01T00:00:00":23.295479,
   "2011-01-03T00:00:00":24.160568,
   "2010-12-01T00:00:00":24.317398,
   "2010-11-01T00:00:00":22.008509,
   "2010-10-01T00:00:00":23.095108,
   "2010-09-01T00:00:00":21.207317,
   "2010-08-02T00:00:00":20.324039,
   "2010-07-01T00:00:00":22.231787,
   "2010-06-01T00:00:00":19.819971,
   "2010-05-03T00:00:00":22.223173,
   "2010-04-01T00:00:00":26.18787,
   "2010-03-01T00:00:00":25.116001,
   "2010-02-01T00:00:00":24.584354,
   "2010-01-04T00:00:00":24.051712,
   "2009-12-01T00:00:00":26.014767,
   "2009-11-02T00:00:00":25.101519,
   "2009-10-01T00:00:00":23.563477,
   "2009-09-01T00:00:00":21.855486,
   "2009-08-03T00:00:00":20.946257,
   "2009-07-01T00:00:00":19.874294,
   "2009-06-01T00:00:00":20.085543,
   "2009-05-01T00:00:00":17.651955,
   "2009-04-01T00:00:00":17.011574,
   "2009-03-02T00:00:00":15.42461,
   "2009-02-02T00:00:00":13.560557,
   "2009-01-02T00:00:00":14.260461,
   "2008-12-01T00:00:00":16.211891,
   "2008-11-03T00:00:00":16.862368,
   "2008-10-01T00:00:00":18.496689,
   "2008-09-02T00:00:00":22.108225,
   "2008-08-01T00:00:00":22.605225,
   "2008-07-01T00:00:00":21.220106,
   "2008-06-02T00:00:00":22.696934,
   "2008-05-01T00:00:00":23.365217,
   "2008-04-01T00:00:00":23.44392,
   "2008-03-03T00:00:00":23.328836,
   "2008-02-01T00:00:00":22.358858,
   "2008-01-02T00:00:00":26.694027,
   "2007-12-03T00:00:00":29.150532,
   "2007-11-01T00:00:00":27.512861,
   "2007-10-01T00:00:00":30.041998,
   "2007-09-04T00:00:00":24.04339,
   "2007-08-01T00:00:00":23.447611,
   "2007-07-02T00:00:00":23.577166,
   "2007-06-01T00:00:00":23.967543,
   "2007-05-01T00:00:00":24.959753,
   "2007-04-02T00:00:00":24.271164,
   "2007-03-01T00:00:00":22.593098,
   "2007-02-01T00:00:00":22.836296,
   "2007-01-03T00:00:00":24.930527,
   "2006-12-01T00:00:00":24.122669,
   "2006-11-01T00:00:00":23.718739,
   "2006-10-02T00:00:00":23.114605,
   "2006-09-01T00:00:00":22.019663,
   "2006-08-01T00:00:00":20.691236,
   "2006-07-03T00:00:00":19.299791,
   "2006-06-01T00:00:00":18.690155,
   "2006-05-01T00:00:00":18.168755,
   "2006-04-03T00:00:00":19.296738,
   "2006-03-01T00:00:00":21.741789,
   "2006-02-01T00:00:00":21.470118,
   "2006-01-27T00:00:00":22.416922
}

404 Not Found

Company not found

Code samples

@ECHO OFF

curl -v -X GET "https://services.last10k.com/v1/company/{ticker}/prices"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://services.last10k.com/v1/company/{ticker}/prices?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://services.last10k.com/v1/company/{ticker}/prices");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://services.last10k.com/v1/company/{ticker}/prices?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://services.last10k.com/v1/company/{ticker}/prices";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://services.last10k.com/v1/company/{ticker}/prices');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('services.last10k.com')
    conn.request("GET", "/v1/company/{ticker}/prices?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('services.last10k.com')
    conn.request("GET", "/v1/company/{ticker}/prices?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://services.last10k.com/v1/company/{ticker}/prices')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body