← Back to API Ninjas

Get GDP data

Get GDP data from given parameters. Returns GDP statistics that satisfy the parameters.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/gdp" }); console.log(output);

Query parameters

country
string

Country name (case-insensitive) or 2-letter ISO-3166 alpha-2 code of the country. E.g. Canada or CA.

year
number

Year for which to retrieve GDP data.

    Orthogonal - Giving AI agents the tools they need.