Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7924221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:38:55+00:00 2026-06-03T17:38:55+00:00

I have a JSON object from the CrunchBase API giving me a bunch of

  • 0

I have a JSON object from the CrunchBase API giving me a bunch of info from a given company. Right now I am trying to go through the JSON object and create a list of their investors. The investors can fall into one of three categories, "company", "financial_org", or "person". All three types will be appended to the same list, finalInvestorList

The script runs without error, but only produces a list of investors from the first listed round. I have logged everything I think might help. the logs are in same-line comments.

Basically my problem is that it is only looping through one time, and therefor only adding the investors from the first round. Any help would be greatly appreciated. Let me know if you need more info!

  var investorList = function(data, num) {
        var fundingRounds = data["funding_rounds"];
        var finalInvestorList = []
        console.log(fundingRounds.length) // 3


        for (i=0; i < fundingRounds.length; i++) {
            var investments = data["funding_rounds"][i]["investments"];
            console.log(data["funding_rounds"][1]["investments"]); //correctly logs the index 1 round for spling (2nd round)
            var round = data["funding_rounds"][i];
            console.log('round' + i); //only logs round0, never loops around for round1, round2
            for (i=0; i < investments.length; i++) {

                var angelObject = round["investments"][i]["person"];
                if (angelObject != null) {
                    console.log("angel fired"); //fires for "Mitch Blumenfeld"
                    var angel = angelObject["first_name"] + " " + angelObject["last_name"];
                    finalInvestorList[i] = angel;
                }

                var financialOrgObject = round["investments"][i]["financial_org"];
                if (financialOrgObject != null) {
                    console.log("financial_org fired"); //fires for "Bucknell Venture Plan Competition"
                    console.log(financialOrgObject['name']); //Bucknell VPC
                    var financialOrg = financialOrgObject["name"]
                    finalInvestorList[i] = financialOrg
                }

                var companyObject = round['investments'][i]["company"];
                if (companyObject != null) {
                    console.log('company fired'); //i haven't bothered with this yet.. just logging it so ill know if its firing
                }
            }
        }
        console.log(finalInvestorList); //["Bucknell Venture Plan Competition", "Mitch Blumenfeld"]

    }

The JSON object represented by the data is as follows
I have shortened it with just the bit needed. The object inside the JSON response data is represented by data[“funding_rounds”]
this data was retrieved using the crunch API and can be found in full form at http://api.crunchbase.com/v/1/company/spling.js

"funding_rounds":
  [{"round_code": "seed",
    "source_url": "",
    "source_description": "",
    "raised_amount": 50000.0,
    "raised_currency_code": "USD",
    "funded_year": 2011,
    "funded_month": 2,
    "funded_day": 1,
    "investments":
     [{"company": null,
       "financial_org":
        {"name": "Bucknell Venture Plan Competition",
         "permalink": "bucknell-venture-plan-competition",
         "image": null},
       "person": null},
      {"company": null,
       "financial_org": null,
       "person":
        {"first_name": "Mitch",
         "last_name": "Blumenfeld",
         "permalink": "mitch-blumenfeld",
         "image": null}}]},
   {"round_code": "seed",
    "source_url": "http://techcrunch.com/2011/09/08/dreamit-ventures-launches-its-fall-2011-philadelphia-class/",
    "source_description": "",
    "raised_amount": 25000.0,
    "raised_currency_code": "USD",
    "funded_year": 2011,
    "funded_month": 9,
    "funded_day": 1,
    "investments":
     [{"company": null,
       "financial_org":
        {"name": "DreamIt Ventures",
         "permalink": "dreamit-ventures",
         "image":
          {"available_sizes":
            [[[150,
               57],
              "assets/images/resized/0002/7773/27773v5-max-150x150.jpg"],
             [[250,
               96],
              "assets/images/resized/0002/7773/27773v5-max-250x250.jpg"],
             [[251,
               97],
              "assets/images/resized/0002/7773/27773v5-max-450x450.jpg"]],
           "attribution": null}},
       "person": null}]},
   {"round_code": "a",
    "source_url": "http://techcrunch.com/2011/12/05/new-content-sharing-network-spling-launches-announces-400k-series-a/",
    "source_description": "New Content Sharing Network Spling Launches, Announces $400K Series A",
    "raised_amount": 400000.0,
    "raised_currency_code": "USD",
    "funded_year": 2011,
    "funded_month": 12,
    "funded_day": 5,
    "investments":
     [{"company": null,
       "financial_org":
        {"name": "Deep Fork Capital",
         "permalink": "deep-fork-capital-2",
         "image":
          {"available_sizes":
            [[[150,
               20],
              "assets/images/resized/0008/0167/80167v1-max-150x150.png"],
             [[250,
               34],
              "assets/images/resized/0008/0167/80167v1-max-250x250.png"],
             [[450,
               62],
              "assets/images/resized/0008/0167/80167v1-max-450x450.png"]],
           "attribution": null}},
       "person": null},
      {"company": null,
       "financial_org": null,
       "person":
        {"first_name": "John",
         "last_name": "Ason",
         "permalink": "john-ason",
         "image": null}},
      {"company": null,
       "financial_org": null,
       "person":
        {"first_name": "Mitchell",
         "last_name": "Blumenfeld",
         "permalink": "mitchell-blumenfeld",
         "image": null}},
      {"company": null,
       "financial_org": null,
       "person":
        {"first_name": "Gianni",
         "last_name": "Martire",
         "permalink": "gianni-martire",
         "image":
          {"available_sizes":
            [[[138,
               150],
              "assets/images/resized/0006/3720/63720v4-max-150x150.jpg"],
             [[230,
               250],
              "assets/images/resized/0006/3720/63720v4-max-250x250.jpg"],
             [[414,
               450],
              "assets/images/resized/0006/3720/63720v4-max-450x450.jpg"]],
           "attribution": ""}}}]}]

Thanks for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T17:39:03+00:00Added an answer on June 3, 2026 at 5:39 pm

    You are using the same variable name for the counter in each loop, so when the inner loop completes and the outer loop gets to its second iteration, i is investments.length, not 1. Use different variable names for each loop:

    for (var roundIdx = 0; roundIdx < fundingRounds.length; roundIdx++) {
        ...
        for (var invIdx = 0; invIdx < investments.length; invIdx++) {
            ...
    

    Also, don’t populate your array using array[i] = value notation, just use array.push(value). You don’t need to keep track of the indexes.

    But, I’d recommend iterating your arrays using Array.forEach() and using dot syntax instead of square bracket notation:

    function investorList(data, num) {
        var finalInvestorList = [];
        data.funding_rounds.forEach(function (round, i) {
            round.investments.forEach(function (investment, i) {
                if (investment.person) {
                    finalInvestorList.push(investment.person.first_name + " " +
                                           investment.person.last_name);
                }
                else if (investment.financial_org) {
                    finalInvestorList.push(investment.financial_org.name)
                }
                else if (investment.company) {
                    finalInvestorList.push(investment.company.name)
                }
            }
        }
    }
    

    For older browsers that don’t natively support Array.forEach(), use the implementation here to shim the browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a json object returned from a third party api, it looks like:
I have a json object that I'm loading from wordpress using the JSON API
I have a JSON Object that is returned from a web service call that
I have a stdClass object created from json_decode that won't return the right number
I have a problem mapping a Json object recieved from the server into a
iv been having trouble trying to set a listview from a json object from
I have a JSON object im decoding from a url like so: $var =
I have the following code grabbing a JSON object from github and I am
I have the json object from remote site. When I vardump the json response.
I have a JSON object returned from server. It looks like this : {1:{id:1,name:autos},

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.