Company key stats API Documentation

Get all data for a company such as 52 week high, 52 week low, market capitalization, and key stats to understand a company finance. Access companies profile (Price, Beta, Volume Average, Market Capitalisation, Last Dividend, 52 week range, stock price change, stock price change in percentage, Company Name, Exchange, Description, Industry, Sector, CEO,Website and image).

Company key stats API Documentation

Get all data for a company such as 52 week high, 52 week low, market capitalization, and key stats to understand a company finance. Access companies profile (Price, Beta, Volume Average, Market Capitalisation, Last Dividend, 52 week range, stock price change, stock price change in percentage, Company Name, Exchange, Description, Industry, Sector, CEO,Website and image).

Company key stats

COMPANIES_KEY_STATS_WITH Javascript

Code it yourself on JSFiddle /api/company/profile/AAPL

COMPANIES_KEY_STATS_LIST_PRICE_WITH Jquery

Code it yourself on JSFiddle /api/company/profile/AAPL

COMPANY_KEY_STATS_WITH JAVA

URL url = new URL("https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json");

try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"))) {
    for (String line; (line = reader.readLine()) != null;) {
    System.out.println(line);
  }
}

COMPANY_KEY_STATS_WITH PHP

set_time_limit(0);

$url_info = "https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json";

$channel = curl_init();

curl_setopt($channel, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($channel, CURLOPT_HEADER, 0);
curl_setopt($channel, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($channel, CURLOPT_URL, $url_info);
curl_setopt($channel, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($channel, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($channel, CURLOPT_TIMEOUT, 0);
curl_setopt($channel, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($channel, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($channel, CURLOPT_SSL_VERIFYPEER, FALSE);

$output = curl_exec($channel);

if (curl_error($channel)) {
    return 'error:' . curl_error($channel);
} else {
 $outputJSON = json_decode($output);
  var_dump($outputJSON);
}

COMPANY_KEY_STATS_WITH NodeJS

const https = require('https')

const options = {
  hostname: 'financialmodelingprep.com',
  port: 443,
  path: '/api/company/profile/AAPL',
  method: 'GET'
}

const req = https.request(options, (res) => {
  res.on('data', (d) => {
    process.stdout.write(d)
  })
})

req.on('error', (error) => {
  console.error(error)
})

req.end()

COMPANY_KEY_STATS_WITH Python

#!/usr/bin/env python

try:
    # For Python 3.0 and later
    from urllib.request import urlopen
except ImportError:
    # Fall back to Python 2's urllib2
    from urllib2 import urlopen

import json

def get_jsonparsed_data(url):
    """
    Receive the content of ``url``, parse it as JSON and return the object.

    Parameters
    ----------
    url : str

    Returns
    -------
    dict
    """
    response = urlopen(url)
    data = response.read().decode("utf-8")
    return json.loads(data)

url = ("https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json")
print(get_jsonparsed_data(url))

COMPANY_KEY_STATS_WITH Go

package main

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

func main() {
    url := "https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json"
    response, err := http.Get(url)
    if err != nil {
        log.Fatal(err)
    }
    defer response.Body.Close()

    responseData, err := ioutil.ReadAll(response.Body)
    if err != nil {
        log.Fatal(err)
    }

    responseString := string(responseData)

    fmt.Println(responseString)
}

COMPANY_KEY_STATS_WITH Ruby

require 'net/http'
require 'uri'

uri = URI.parse("https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json")
request = Net::HTTP::Get.new(uri)
request["Upgrade-Insecure-Requests"] = "1"

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

# response.code
# response.body

COMPANY_KEY_STATS_WITH C#

using (var httpClient = new HttpClient())

{
    using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json"))

    {
        request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1");

        var response = await httpClient.SendAsync(request);
    }
}

COMPANY_KEY_STATS_WITH R

require(httr)

headers = c(
  `Upgrade-Insecure-Requests` = '1',
)

params = list(
  `datatype` = 'json'
)

res <- httr::GET(url = 'https://financialmodelingprep.com/api/company/profile/AAPL', httr::add_headers(.headers=headers), query = params)

COMPANY_KEY_STATS_WITH Strest

version: 2
requests:
  curl_converter:
    request:
      url: 'https://financialmodelingprep.com/api/company/profile/AAPL'
      method: GET
      headers:
        -
          name: Upgrade-Insecure-Requests
          value: '1'
        -
      queryString:
        -
          name: datatype
          value: json

COMPANY_KEY_STATS_WITH Rust

extern crate reqwest;

use reqwest::headers::*;

fn main() -> Result<(), reqwest::Error> {

    let mut headers = HeaderMap::new();

    headers.insert(UPGRADE_INSECURE_REQUESTS, "1".parse().unwrap());

    let res = reqwest::Client::new()
        .get("https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json")
        .headers(headers)
        .send()?
        .text()?;

    println!("{}", res);

    Ok(())
}

COMPANY_KEY_STATS_WITH Swift

import PlaygroundSupport

import Foundation

let url = URL(string: "https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json")

var request = URLRequest(url: url!)

request.addValue("application/json", forHTTPHeaderField: "Accept")
let task = URLSession.shared.dataTask(with: url!) { data, response, error in
    guard error == nil else {
        print(error!)
        return
    }
    guard let data = data else {
        print("Data is empty")
        return
    }

    let json = try! JSONSerialization.jsonObject(with: data, options: [])
    print(json)
}

task.resume()
PlaygroundPage.current.needsIndefiniteExecution = true

COMPANY_KEY_STATS_WITH Scala

import scala.io.Source.fromURL

val json = fromURL("https://financialmodelingprep.com/api/company/profile/AAPL?datatype=json").mkString

print(json)

Resource List :