> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ngnmarket.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a Company Profile and Price Chart

> Look up a company's full profile, current price, and 30-day price history in two requests.

This example fetches the full profile for Dangote Cement (DANGCEM), including sector, market cap, 52-week range, and current price, alongside a 30-day price history. You can substitute any NGX ticker symbol.

**Endpoints used:**

* `GET /companies/:symbol` (Starter plan)
* `GET /companies/:symbol/chart` (Starter plan)

## Step 1: Fetch the company profile

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.ngnmarket.com/v1/companies/DANGCEM" \
    -H "Authorization: Bearer ngm_live_YOUR_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    'https://api.ngnmarket.com/v1/companies/DANGCEM',
    { headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' } }
  );
  const { data } = await res.json();
  // data.current_price, data.market_cap, data.sector, etc.
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      'https://api.ngnmarket.com/v1/companies/DANGCEM',
      headers={'Authorization': 'Bearer ngm_live_YOUR_KEY'},
  )
  profile = res.json()['data']
  ```
</CodeGroup>

### Sample response (trimmed)

```json theme={null}
{
  "success": true,
  "data": {
    "symbol": "DANGCEM",
    "company_name": "Dangote Cement Plc",
    "sector": "Industrial Goods",
    "current_price": 302.50,
    "price_change": 4.00,
    "price_change_percent": 1.34,
    "market_cap": 5150820750000,
    "week_52_high": 325.00,
    "week_52_low": 241.00,
    "listing_date": "2010-10-26",
    "isin": "NGDANGCEM006"
  }
}
```

## Step 2: Fetch the 30-day price chart

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.ngnmarket.com/v1/companies/DANGCEM/chart?period=30d" \
    -H "Authorization: Bearer ngm_live_YOUR_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    'https://api.ngnmarket.com/v1/companies/DANGCEM/chart?period=30d',
    { headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' } }
  );
  const { data } = await res.json();
  // data.data → array of daily price points
  ```

  ```python Python theme={null}
  res = requests.get(
      'https://api.ngnmarket.com/v1/companies/DANGCEM/chart',
      params={'period': '30d'},
      headers={'Authorization': 'Bearer ngm_live_YOUR_KEY'},
  )
  chart = res.json()['data']['data']
  ```
</CodeGroup>

### Sample response (trimmed)

```json theme={null}
{
  "success": true,
  "data": {
    "symbol": "DANGCEM",
    "period": "30d",
    "count": 22,
    "data": [
      {
        "date": "2026-04-17",
        "close_price": 302.50,
        "change": 4.00,
        "change_percent": 1.34
      },
      {
        "date": "2026-04-16",
        "close_price": 298.50,
        "change": -1.50,
        "change_percent": -0.50
      }
    ],
    "statistics": {
      "period_change": 18.50,
      "period_change_percent": 6.52,
      "min_price": 278.00,
      "max_price": 305.00
    }
  }
}
```

## Fetch both calls in parallel

In JavaScript you can fire both requests simultaneously:

```javascript JavaScript theme={null}
const [profileRes, chartRes] = await Promise.all([
  fetch('https://api.ngnmarket.com/v1/companies/DANGCEM', {
    headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' },
  }),
  fetch('https://api.ngnmarket.com/v1/companies/DANGCEM/chart?period=30d', {
    headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' },
  }),
]);

const [{ data: profile }, { data: chart }] = await Promise.all([
  profileRes.json(),
  chartRes.json(),
]);
```

<CardGroup cols={2}>
  <Card title="Company detail reference" icon="book" href="/api-reference/companies/detail">
    All fields returned by `GET /companies/:symbol`
  </Card>

  <Card title="Price chart reference" icon="book" href="/api-reference/companies/chart">
    Parameters for `GET /companies/:symbol/chart`
  </Card>
</CardGroup>
