Understanding the default json output

Elyx0 edited this page May 12, 2015 · 1 revision

KeywordMeme™ Output Schema

The json output contains 2 objects:

[{Object},{Object}]

Object (0)

This segment of the output contains all pertinent information about the request that was passed through the KeywordMeme API. It is a single object that contains 12 property values.

Example:

{
    // Name of object
    name: "DAE_query_info", 

    // The expression of the API query expression(q).
    term: "Javascript", 

    // The unique identifier created by the system for this API request. 
    // All subsequent fetch operations are based on this identifier.
    query_token: "qry_233bf79129abff277c7b4159a1efacbd", 

    // The current state of the query is expressed as the status.   
    // This status states are {"processing","success","failed","pending"} 
    // A "collecting" status exists too but is not yet implemented. 
    status: "success",

    // Represents the value of the geocode used in the API request
    geocode: null,

    // Denotes the ISO 639-1 language code used during the API request
    lang: "en",

    // The amount of time(in minutes) for each interval for the API request
    interval_window: 10,

    // Indicates the amount of records used to set each interval for the API request 
    interval_records: 0,
    max_records: 300,

    // Indicates the earliest date/time of records returned that was specified 
    // in the API request.
    start_date: null,

    // Indicates the latest date/time of records returned that was specified 
    // in the API request
    end_date: null,

    // Source type that was collected from by the API request.
    source: "Twitter",
    
    // Indicates whether or not the blank intervals should be filled
    create_blank_interval: true,

    // Indicates if the query is a streaming changing query
    stream: false,

    // Message containing information as to the status, 
    // KeywordMemes processed or any errors that were encountered from the API request.
    message: "== Done processing 1266 keyword memes for requestId:qry_233bf79129abff277c7b4159a1efacbd"
}

Status field states

"processing" // The data has been collected and being processed through the system.

"success" // The current request has been successfully processed and is available for output.

"failed" // The current request was not successfully passed through the system, see message for explanation.

>//Status messages not yet implemented:_

"collecting" // The current request data is being collected from the source prior to processing through the system.

"pending" // The current request is in queue for collection and processing.

Object (1)

This segment of the output contains all the KeywordMemes, and Term Clusters, for all the processed and defined intervals in a chronological and hierarchical array data structure.

Its simplified structure looks as follow:

{
    name:"DAE_intervals",
    children: [
        {
            some_interval_header_fields: '',
            children: [{KeywordMeme},{Clusters}]
        },
        {
            another_interval_header_fields: '',
            children: [{KeywordMeme},{Clusters}]
        }
    ]
}

Example:

{
    // Name of object (1)
    name: "DAE_intervals",

    // [Array]
    // Each interval returns the following sections:  
    // - An interval "header" and a children array that contains the 
    // interval’s KeywordMeme and the interval Term Clusters.
    //  
    // - All terms within the KeywordMeme and the Clusters for a 
    // given interval have been found within the filters set in the DAE_query_info.
    children: [{
        
        // Unique id generated by the API for each interval.
        interval_id: "2385743",

        // Follows the syntax "DAE_interval" + <interval start_time> 
        name: "DAE_interval 2015-05-12 15:40:00 UTC", 

        // Start time for the current interval returned by the API.
        interval_start_time: "2015-05-12 15:40:00 UTC",

        // Ending time for the current interval returned by the API.
        interval_end_time: "2015-05-12 15:50:00 UTC",

        // Start time for the current interval returned by the API.
        interval_first_record_time: "2015-05-12 15:47:00 UTC",

        // Indicates when, during the current interval, the first record was found.
        interval_last_record_time: "2015-05-12 15:49:00 UTC",

        // The number of times the query term was found within the current interval.
        record_count: "13",

        // [Array] of {keyword_meme,clusters}
        // Each children array of an interval contains a single keyword_meme and a single cluster.
        children: [{

            // May contain 1 to many terms in its children array (there is only one keyword_meme per interval)
            name: "DAE_keyword_meme",

            // Children presence is optional, it is possible to populate 
            // the keyword_meme section with the &include_keywordmeme=1
            // See below for [[DAE_keyword_meme inclusion]]
            children: []
        }, {
            //  The name given to the cluster collection 
            name: "DAE_clusters",

            // May contain 1 to many cluster objects in its children array 
            children: [{

                // "cluster" + "_The name of the primary and common term of the cluster_"
                name: "cluster php",
                keyword_count: 3,
                source_record_ids: [
                    "598153006136299521",
                    "598152824493449216",
                    "598152673209294848"
                ],
                // May contain 1 to many terms in its children array
                children: [{
                    // The term name contained in this cluster
                    name: "developer",

                    // Returns how many times this keyword appears in the given interval
                    keyword_count: 3,

                    // The record pointer to the source record that
                    // contains this term found in the current interval 
                    source_record_ids: [
                        "598153006136299521",
                        "598152824493449216",
                        "598152673209294848"
                    ]
                }, {
                    name: "ruby",
                    keyword_count: 1,
                    source_record_ids: [
                        "598152824493449216"
                    ]
                }]
            }]
    }]
}]
}

DAE_keyword_meme inclusion

When adding &include_keywordmeme=1 to your api fetch request like:

http://api.keywordmeme.com/v1/fetch?query_token=your_query_id&api_token=your_api_token&include_keywordmeme=1

The previous array of keyword meme will get populated with correlated keywords

As seen above:

            name: "DAE_keyword_meme",
            // Children presence is optional, it is possible to populate 
            // the keyword_meme section with the &include_keywordmeme=1
            // See below for [[DAE_keyword_meme inclusion]]
            children: []
        }

Will become:

name: "DAE_keyword_meme",
children: [{

    // The name of the term
    name: "php",

    // Will contain all the terms that are associated with this term (here: php) 
    // throughout the current interval
    correlated_kws: [
        "jquery",
        "certified",
        "ansible",
        "rocketinternet",
    ],
    // The record pointer to the source record that contains this term (php)
    // found in the current interval 
    source_record_ids: [
        "598153006136299521",
        "598152824493449216",
        "598152673209294848"
    ],
    // The date/time stamp of each instance of the term (php) 
    // found in the current interval
    source_record_dates: [
        "2015-05-12 15:49:00 UTC",
        "2015-05-12 15:48:00 UTC",
        "2015-05-12 15:48:00 UTC"
    ],
    // Returns how many times this term (php) is found in the current interval
    keyword_count: "3"
}, { 
    // Others keywords and correlated keywords might follow:
    name: "developer",
    correlated_kws: [
        "jque",
        "certified",
        "ansible",
        "rocketinternet",
        "aclouddev",
        "ruby",
    ],
    source_record_ids: [
        "598153006136299521",
        "598152824493449216",
        "598152673209294848"
    ],
    source_record_dates: [
        "2015-05-12 15:49:00 UTC",
        "2015-05-12 15:48:00 UTC",
        "2015-05-12 15:48:00 UTC"
    ],
    keyword_count: "3"
}, {
    name: "ruby",
    correlated_kws: [
        "certified",
        "aclouddev",
        "developer",
        "19usd",
        "aws",
        "php",
        "online"
    ],
    source_record_ids: [
        "598152824493449216"
    ],
    source_record_dates: [
        "2015-05-12 15:48:00 UTC"
    ],
    keyword_count: "1"
}, {
    name: "visual",
    correlated_kws: [
        "linux",
        "studio",
        "written",
        "kaepora",
        "exists",
        "2015"
    ],
    source_record_ids: [
        "598152930752094208"
    ],
    source_record_dates: [
        "2015-05-12 15:49:00 UTC"
    ],
    keyword_count: "1"
}]

For a full report of a sample json see Sample JSON

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.