Company API
API change historyA collection of RESTful methods that returns various financial data for a requested company including balance sheets, stock quotes , company look-up utilities and more.
Sections
Returns a list of financial statements and disclosures from a company's Annual or Quarterly report.
* Form Types supported: 10-K 10-Q 20-F 40-F
** Use the CIK and Accession Number values returned from the Company Filings endpoint for this endpoint's Request Parameters.
*** Last10K.com is not affiliated with SEC.gov; please adhere to their Internet Security Policy if accessing their data.

Request
Request URL
Request parameters
-
string
Central Index Key (CIK)
-
string
SEC Filing Identifier
Request headers
Request body
Responses
200 OK
Company Found
Representations
{
"meta": {
"copyright": "Copyright 2021 Last10K.com All Rights Reserverd",
"terms": ["https://dev.last10k.com/terms", "https://www.sec.gov/privacy.htm#security"]
},
"data": {
"attributes": {
"status": 0,
"company": {
"name": "Walmart Inc.",
"cik": "104169",
"ticker": "wmt"
},
"filing": {
"accessionNumber": "0000104169-21-000033",
"filingDate": "2021-03-19T00:00:00",
"formType": "10-K"
},
"count": 78,
"result": [{
"Id": "2120105",
"HtmlFileName": "R12.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R12.htm",
"Section": "Disclosure",
"Name": "Accrued Liabilities"
}, {
"Id": "2422411",
"HtmlFileName": "R46.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R46.htm",
"Section": "Disclosure",
"Name": "Accrued Liabilities (Schedule Of Accrued Liabilities) (Details)"
}, {
"Id": "2321305",
"HtmlFileName": "R27.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R27.htm",
"Section": "Disclosure",
"Name": "Accrued Liabilities (Tables)"
}, {
"Id": "2117104",
"HtmlFileName": "R11.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R11.htm",
"Section": "Disclosure",
"Name": "Accumulated Other Comprehensive Loss"
}, {
"Id": "2419410",
"HtmlFileName": "R45.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R45.htm",
"Section": "Disclosure",
"Name": "Accumulated Other Comprehensive Loss (Composition Of Accumulated Other Comprehensive Income) (Details)"
}, {
"Id": "2318304",
"HtmlFileName": "R26.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R26.htm",
"Section": "Disclosure",
"Name": "Accumulated Other Comprehensive Loss (Tables)"
}, {
"Id": "1003004",
"HtmlFileName": "R4.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R4.htm",
"Section": "Statement",
"Name": "Consolidated Balance Sheets"
}, {
"Id": "1006007",
"HtmlFileName": "R7.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R7.htm",
"Section": "Statement",
"Name": "Consolidated Statements Of Cash Flows"
}, {
"Id": "1002003",
"HtmlFileName": "R3.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R3.htm",
"Section": "Statement",
"Name": "Consolidated Statements Of Comprehensive Income"
}, {
"Id": "1001002",
"HtmlFileName": "R2.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R2.htm",
"Section": "Statement",
"Name": "Consolidated Statements Of Income"
}, {
"Id": "1004005",
"HtmlFileName": "R5.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R5.htm",
"Section": "Statement",
"Name": "Consolidated Statements Of Shareholders' Equity"
}, {
"Id": "1005006",
"HtmlFileName": "R6.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R6.htm",
"Section": "Statement",
"Name": "Consolidated Statements Of Shareholders' Equity (Parenthetical)"
}, {
"Id": "2151110",
"HtmlFileName": "R17.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R17.htm",
"Section": "Disclosure",
"Name": "Contingencies"
}, {
"Id": "2452432",
"HtmlFileName": "R67.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R67.htm",
"Section": "Disclosure",
"Name": "Contingencies (Details)"
}, {
"Id": "0001001",
"HtmlFileName": "R1.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R1.htm",
"Section": "Document",
"Name": "Cover Page"
}, {
"Id": "2157112",
"HtmlFileName": "R19.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R19.htm",
"Section": "Disclosure",
"Name": "Disposals, Acquisitions And Related Items"
}, {
"Id": "2460436",
"HtmlFileName": "R71.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R71.htm",
"Section": "Disclosure",
"Name": "Disposals, Acquisitions And Related Items (Assets And Liabilities Held For Sale) (Details)"
}, {
"Id": "2459435",
"HtmlFileName": "R70.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R70.htm",
"Section": "Disclosure",
"Name": "Disposals, Acquisitions And Related Items (Narrative) (Details)"
}, {
"Id": "2358311",
"HtmlFileName": "R33.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R33.htm",
"Section": "Disclosure",
"Name": "Disposals, Acquisitions And Related Items (Tables)"
}, {
"Id": "2136108",
"HtmlFileName": "R15.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R15.htm",
"Section": "Disclosure",
"Name": "Fair Value Measurements"
}, {
"Id": "2441424",
"HtmlFileName": "R59.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R59.htm",
"Section": "Disclosure",
"Name": "Fair Value Measurements (Carrying Value And Fair Value Of Long-Term Debt) (Details)"
}, {
"Id": "2440423",
"HtmlFileName": "R58.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R58.htm",
"Section": "Disclosure",
"Name": "Fair Value Measurements (Narrative) (Details)"
}, {
"Id": "2439422",
"HtmlFileName": "R57.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R57.htm",
"Section": "Disclosure",
"Name": "Fair Value Measurements (Notional Amounts And Fair Values Of Interest Rate Swaps) (Details)"
}, {
"Id": "2438421",
"HtmlFileName": "R56.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R56.htm",
"Section": "Disclosure",
"Name": "Fair Value Measurements (Recurring And Nonrecurring) (Details)"
}, {
"Id": "2337308",
"HtmlFileName": "R30.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R30.htm",
"Section": "Disclosure",
"Name": "Fair Value Measurements (Tables)"
}, {
"Id": "2131107",
"HtmlFileName": "R14.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R14.htm",
"Section": "Disclosure",
"Name": "Leases"
}, {
"Id": "2433418",
"HtmlFileName": "R53.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R53.htm",
"Section": "Disclosure",
"Name": "Leases (Leases Cost) (Details)"
}, {
"Id": "2435420",
"HtmlFileName": "R55.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R55.htm",
"Section": "Disclosure",
"Name": "Leases (Lessee Liability Maturity) (Details)"
}, {
"Id": "2434419",
"HtmlFileName": "R54.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R54.htm",
"Section": "Disclosure",
"Name": "Leases (Schedule Of Other Information Relating To Lease Liabilities) (Details)"
}, {
"Id": "2332307",
"HtmlFileName": "R29.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R29.htm",
"Section": "Disclosure",
"Name": "Leases (Tables)"
}, {
"Id": "2107102",
"HtmlFileName": "R9.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R9.htm",
"Section": "Disclosure",
"Name": "Net Income Per Common Share"
}, {
"Id": "2409404",
"HtmlFileName": "R39.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R39.htm",
"Section": "Disclosure",
"Name": "Net Income Per Common Share (Schedule Of Calculation Of Numerator And Denominator In Earnings Per Share) (Details)"
}, {
"Id": "2308302",
"HtmlFileName": "R24.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R24.htm",
"Section": "Disclosure",
"Name": "Net Income Per Common Share (Tables)"
}, {
"Id": "2153111",
"HtmlFileName": "R18.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R18.htm",
"Section": "Disclosure",
"Name": "Retirement-Related Benefits"
}, {
"Id": "2455433",
"HtmlFileName": "R68.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R68.htm",
"Section": "Disclosure",
"Name": "Retirement-Related Benefits (Narrative) (Details)"
}, {
"Id": "2456434",
"HtmlFileName": "R69.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R69.htm",
"Section": "Disclosure",
"Name": "Retirement-Related Benefits (Schedule Of Contribution Expense Related To Defined Contribution Plans) (Details)"
}, {
"Id": "2354310",
"HtmlFileName": "R32.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R32.htm",
"Section": "Disclosure",
"Name": "Retirement-Related Benefits (Tables)"
}, {
"Id": "2161113",
"HtmlFileName": "R20.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R20.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue"
}, {
"Id": "2463437",
"HtmlFileName": "R72.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R72.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue (Narrative) (Details)"
}, {
"Id": "2466440",
"HtmlFileName": "R75.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R75.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue (Revenue From Contract With Customer Excluding Assessed Tax Walmart U.S) (Details)"
}, {
"Id": "2467441",
"HtmlFileName": "R76.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R76.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue (Revenue From Contract With Customer Excluding Assessed Tax, International) (Details)"
}, {
"Id": "2468442",
"HtmlFileName": "R77.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R77.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue (Revenue From Contract With Customer Excluding Assessed Tax, Sam's Club) (Details)"
}, {
"Id": "2464438",
"HtmlFileName": "R73.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R73.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue (Schedule Of Segment Reporting Information By Segment) (Details)"
}, {
"Id": "2465439",
"HtmlFileName": "R74.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R74.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue (Segment Revenues And Long-Lived Assets) (Details)"
}, {
"Id": "2362312",
"HtmlFileName": "R34.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R34.htm",
"Section": "Disclosure",
"Name": "Segments And Disaggregated Revenue (Tables)"
}, {
"Id": "2110103",
"HtmlFileName": "R10.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R10.htm",
"Section": "Disclosure",
"Name": "Shareholders' Equity"
}, {
"Id": "2412405",
"HtmlFileName": "R40.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R40.htm",
"Section": "Disclosure",
"Name": "Shareholders' Equity (Narrative) (Details)"
}, {
"Id": "2414407",
"HtmlFileName": "R42.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R42.htm",
"Section": "Disclosure",
"Name": "Shareholders' Equity (Rollforward Of Activity By Award Type) (Details)"
}, {
"Id": "2415408",
"HtmlFileName": "R43.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R43.htm",
"Section": "Disclosure",
"Name": "Shareholders' Equity (Schedule Of Fair Value Of Restricted Stock) (Details)"
}, {
"Id": "2416409",
"HtmlFileName": "R44.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R44.htm",
"Section": "Disclosure",
"Name": "Shareholders' Equity (Schedule Of Share Repurchases) (Details)"
}, {
"Id": "2413406",
"HtmlFileName": "R41.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R41.htm",
"Section": "Disclosure",
"Name": "Shareholders' Equity (Share Based Compensation Expense) (Details)"
}, {
"Id": "2311303",
"HtmlFileName": "R25.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R25.htm",
"Section": "Disclosure",
"Name": "Shareholders' Equity (Tables)"
}, {
"Id": "2123106",
"HtmlFileName": "R13.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R13.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt"
}, {
"Id": "2425412",
"HtmlFileName": "R47.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R47.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt (Narrative) (Details)"
}, {
"Id": "2428415",
"HtmlFileName": "R50.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R50.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt (Schedule Of Debt Maturities) (Details)"
}, {
"Id": "2430417",
"HtmlFileName": "R52.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R52.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt (Schedule Of Debt Repayments) (Details)"
}, {
"Id": "2429416",
"HtmlFileName": "R51.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R51.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt (Schedule Of Fiscal Debt Issuances) (Details)"
}, {
"Id": "2426413",
"HtmlFileName": "R48.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R48.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt (Schedule Of Lines Of Credit) (Details)"
}, {
"Id": "2427414",
"HtmlFileName": "R49.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R49.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt (Schedule Of Long-Term Debt) (Details)"
}, {
"Id": "2324306",
"HtmlFileName": "R28.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R28.htm",
"Section": "Disclosure",
"Name": "Short-Term Borrowings And Long-Term Debt (Tables)"
}, {
"Id": "2169114",
"HtmlFileName": "R21.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R21.htm",
"Section": "Disclosure",
"Name": "Subsequent Event"
}, {
"Id": "2471443",
"HtmlFileName": "R78.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R78.htm",
"Section": "Disclosure",
"Name": "Subsequent Event (Details)"
}, {
"Id": "2370313",
"HtmlFileName": "R35.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R35.htm",
"Section": "Disclosure",
"Name": "Subsequent Event (Tables)"
}, {
"Id": "2101101",
"HtmlFileName": "R8.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R8.htm",
"Section": "Disclosure",
"Name": "Summary Of Significant Accounting Policies"
}, {
"Id": "2404401",
"HtmlFileName": "R36.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R36.htm",
"Section": "Disclosure",
"Name": "Summary Of Significant Accounting Policies (Narrative) (Details)"
}, {
"Id": "2202201",
"HtmlFileName": "R22.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R22.htm",
"Section": "Disclosure",
"Name": "Summary Of Significant Accounting Policies (Policies)"
}, {
"Id": "2406403",
"HtmlFileName": "R38.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R38.htm",
"Section": "Disclosure",
"Name": "Summary Of Significant Accounting Policies (Schedule Of Goodwill) (Details)"
}, {
"Id": "2405402",
"HtmlFileName": "R37.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R37.htm",
"Section": "Disclosure",
"Name": "Summary Of Significant Accounting Policies (Schedule Of Property, Plant And Equipment) (Details)"
}, {
"Id": "2303301",
"HtmlFileName": "R23.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R23.htm",
"Section": "Disclosure",
"Name": "Summary Of Significant Accounting Policies (Tables)"
}, {
"Id": "2142109",
"HtmlFileName": "R16.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R16.htm",
"Section": "Disclosure",
"Name": "Taxes"
}, {
"Id": "2446427",
"HtmlFileName": "R62.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R62.htm",
"Section": "Disclosure",
"Name": "Taxes (Narrative) (Details)"
}, {
"Id": "2450431",
"HtmlFileName": "R66.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R66.htm",
"Section": "Disclosure",
"Name": "Taxes (Reconciliation Of Unrecognized Tax Benefits From Continuing Operations) (Details)"
}, {
"Id": "2448429",
"HtmlFileName": "R64.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R64.htm",
"Section": "Disclosure",
"Name": "Taxes (Schedule Of Deferred Tax Balances) (Details)"
}, {
"Id": "2449430",
"HtmlFileName": "R65.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R65.htm",
"Section": "Disclosure",
"Name": "Taxes (Schedule Of Deferred Tax Classification In The Balance Sheet) (Details)"
}, {
"Id": "2444425",
"HtmlFileName": "R60.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R60.htm",
"Section": "Disclosure",
"Name": "Taxes (Schedule Of Income Before Income Taxes) (Details)"
}, {
"Id": "2445426",
"HtmlFileName": "R61.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R61.htm",
"Section": "Disclosure",
"Name": "Taxes (Schedule Of Income Tax Provision) (Details)"
}, {
"Id": "2447428",
"HtmlFileName": "R63.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R63.htm",
"Section": "Disclosure",
"Name": "Taxes (Schedule Of Income Tax Rate) (Details)"
}, {
"Id": "2343309",
"HtmlFileName": "R31.htm",
"Url": "https://www.sec.gov/Archives/edgar/data/104169/000010416921000033/R31.htm",
"Section": "Disclosure",
"Name": "Taxes (Tables)"
}]
},
"type": "sections",
"id": "31bfa51b-90c3-4b40-a22f-354d41450485"
}
}
404 Not Found
Company not found
204 No Content
Company found but no data available
Code samples
@ECHO OFF
curl -v -X GET "https://services.last10k.com/v1/company/{cik}/sections?accessionNumber={string}"
-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}");
// Request parameters
queryString["accessionNumber"] = "{string}";
var uri = "https://services.last10k.com/v1/company/{cik}/sections?" + 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/{cik}/sections");
builder.setParameter("accessionNumber", "{string}");
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
"accessionNumber": "{string}",
};
$.ajax({
url: "https://services.last10k.com/v1/company/{cik}/sections?" + $.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/{cik}/sections";
NSArray* array = @[
// Request parameters
@"entities=true",
@"accessionNumber={string}",
];
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/{cik}/sections');
$url = $request->getUrl();
$headers = array(
// Request headers
'Ocp-Apim-Subscription-Key' => '{subscription key}',
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
'accessionNumber' => '{string}',
);
$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({
# Request parameters
'accessionNumber': '{string}',
})
try:
conn = httplib.HTTPSConnection('services.last10k.com')
conn.request("GET", "/v1/company/{cik}/sections?%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({
# Request parameters
'accessionNumber': '{string}',
})
try:
conn = http.client.HTTPSConnection('services.last10k.com')
conn.request("GET", "/v1/company/{cik}/sections?%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/{cik}/sections')
query = URI.encode_www_form({
# Request parameters
'accessionNumber' => '{string}'
})
if uri.query && uri.query.length > 0
uri.query += '&' + query
else
uri.query = query
end
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