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 7664271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:15:50+00:00 2026-05-31T14:15:50+00:00

I am trying to parse this JSONbut it does not have the array with

  • 0

I am trying to parse this JSONbut it does not have the array with respect i will get the count.

As I used to parse
if the JSONwill be:

{
    "earthquakes": [
        {
            "eqid": "c0001xgp",
            "magnitude": 8.8,
            "lng": 142.369,
            "src": "us",
            "datetime": "2011-03-11 04:46:23",
            "depth": 24.4,
            "lat": 38.322
        },
        {
            "eqid": "2007hear",
            "magnitude": 8.4,
            "lng": 101.3815,
            "src": "us",
            "datetime": "2007-09-12 09:10:26",
            "depth": 30,
            "lat": -4.5172
        },
        {
            "eqid": "2007aqbk",
            "magnitude": 8,
            "lng": 156.9567,
            "src": "us",
            "datetime": "2007-04-01 18:39:56",
            "depth": 10,
            "lat": -8.4528
        },
        {
            "eqid": "2007hec6",
            "magnitude": 7.8,
            "lng": 100.9638,
            "src": "us",
            "datetime": "2007-09-12 21:49:01",
            "depth": 10,
            "lat": -2.5265
        },
        {
            "eqid": "a00043nx",
            "magnitude": 7.7,
            "lng": 100.1139,
            "src": "us",
            "datetime": "2010-10-25 12:42:22",
            "depth": 20.6,
            "lat": -3.4841
        },
        {
            "eqid": "2010utc5",
            "magnitude": 7.7,
            "lng": 97.1315,
            "src": "us",
            "datetime": "2010-04-06 20:15:02",
            "depth": 31,
            "lat": 2.3602
        },
        {
            "eqid": "2009mebz",
            "magnitude": 7.6,
            "lng": 99.9606,
            "src": "us",
            "datetime": "2009-09-30 08:16:09",
            "depth": 80,
            "lat": -0.7889
        },
        {
            "eqid": "2009kdb2",
            "magnitude": 7.6,
            "lng": 92.9226,
            "src": "us",
            "datetime": "2009-08-10 17:55:39",
            "depth": 33.1,
            "lat": 14.0129
        },
        {
            "eqid": "2010zbca",
            "magnitude": 7.6,
            "lng": 123.533,
            "src": "us",
            "datetime": "2010-07-23 20:51:11",
            "depth": 576.3,
            "lat": 6.4939
        },
        {
            "eqid": "2010xkbv",
            "magnitude": 7.5,
            "lng": 91.9379,
            "src": "us",
            "datetime": "2010-06-12 17:26:50",
            "depth": 35,
            "lat": 7.7477
        }
    ]
}

The code:

JSONObject json = JSONfunctions.getJSONfromURL("url");
JSONArray  earthquake= json.getJSONArray("earthquakes");

but i have got this type

[
    {
        "id": "4",
        "head": "gggg",
        "details": "gdhghfhgfh",
        "d2": "jkjkjk",
        "datetime": "2012-03-12",
        "last_update": "2012-03-14 05:08:32"
    },
    {
        "id": "5",
        "head": "bb1",
        "details": "sddassa",
        "d2": "ddsdsddsd",
        "datetime": "0000-00-00",
        "last_update": "2012-03-13 07:33:56"
    },
    {
        "id": "3",
        "head": "hhh",
        "details": "hhhh",
        "d2": "dsdsdds",
        "datetime": "2012-03-01",
        "last_update": "2012-03-12 08:35:27"
    }
]

there is nothing like “earthquake” in previous one.

  • 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-05-31T14:15:52+00:00Added an answer on May 31, 2026 at 2:15 pm

    You can directly convert server response is an array of data, then you can directly convert it into JSONArray using JSONArray arr = new JSONArray(stringResponse);

    If you get JSON response in string then you can convert it into JSONArray as follows

            String stringResponse = JSONfunctions.getJSONResponsefromURL("url");
            try {
                JSONArray arr = new JSONArray(stringResponse);
            } catch (JSONException e) {
                e.printStackTrace();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a probably quite simple to solve problem. I'm trying to parse this
I am trying to parse this date with SimpleDateFormat and it is not working:
I am trying to parse this json data from the url but i get
Am trying to parse this HTML document to get the contents of flight, time,
I am trying to parse this test.json (It does validates, so that doesn't appear
I have been trying to parse this ( http://app.calvaryccm.com/mobile/android/v1/devos ) URL using a SAX
I have been trying to parse this xml in c# <schema uri=http://blah.com/schema > <itemGroups>
I'm trying to parse this XML string: <?xml version=1.0 encoding=UTF-8 standalone=no?> <response type=success> <lots>
I am beginner in PHP. I am trying to parse this xml file. <relationship>
I am trying to figure out the best way to parse this comma delimited

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.