Last updated April 2, 2014. Created by redndahead on February 16, 2006.
Edited by MadChris, mpdonadio, vegantriathlete, MD3. Log in to edit this page.

Here is an overview of the node object broken down into Drupal 7, Drupal 6 and Drupal 5.

7.x - $node - Node object

$node->nid Node ID.
$node->vid The revision ID of the current version of this node.
$node->type Type of node (e.g. book, page, forum), which is also the entity bundle.
$node->language The default language for this node.
$node->title Page (or, more accurately, node) title.
$node->uid User ID of node creator.
$node->status unpublished/published (NODE_NOT_PUBLISHED | NODE_PUBLISHED).
$node->created UNIX timestamp of node creation date.
$node->changed UNIX timestamp of last time node was changed.
$node->comment Whether comments are allowed on this node (COMMENT_NODE_HIDDEN | COMMENT_NODE_CLOSED | COMMENT_NODE_OPEN)
$node->promote Promoted to front page (NODE_NOT_PROMOTED | NODE_PROMOTED).
$node->sticky Sticky (NODE_NOT_STICKY | NODE_STICKY).
$node->tnid The node ID of the translation source (or parent, if node is a translation).
$node->translate Does the translation need to be updated (0|1)?
$node->revision_uid The user ID of the user who created the current revision.
$node->body Array. Body content of node. Long text field with summary.
Note: Don't assume that this field will exist, as it is possible to remove it via Manage Fields on each content type. Similarly, modules that define a custom node content type may not even attach a body in the first place.
$node->log Message left by the creator of this revision, explaining the changes.
$node->revision_timestamp Unix timestamp showing when current revision was created.
$node->name Username of node creator.
$node->picture User avatar of the node creator.
$node->cid CID of last comment?
$node->last_comment_timestamp Timestamp of last comment (Unix Epoch C).
$node->last_comment_name Name of last comment author
$node->last_comment_uid UID of last comment author.
$node->comment_count Number of comments made on node.
$node->data Serialized string of data associated with the node.
$node->rdf_mapping W3C standard to describe structured data. See http://api.drupal.org/api/drupal/modules!rdf!rdf.module/group/rdf/7

6.x - $node - Node object

$node->nid Node ID.
$node->type Type of node (e.g. book, page, forum).
$node->language The default language for this node.
$node->uid User ID of node creator.
$node->status unpublished/published (0|1).
$node->created UNIX timestamp of node creation date.
$node->changed UNIX timestamp of last time node was changed.
$node->comment Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.
$node->promote Promoted to front page (0|1).
$node->moderate Moderation enabled (0|1). Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used. (From: http://api.drupal.org/api/file/modules/node/node.install/6/source)
$node->sticky Sticky (0|1).
$node->tnid The node ID of the translation source (or parent, if node is a translation).
$node->translate Is a translation (0|1).
$node->vid The revision ID of the current version of this node.
$node->revision_uid The user ID of the user who created the current revision.
$node->title Page (or, more accurately, node) title.
$node->body Body content of node.
$node->teaser Teaser (the initial part of the body).
$node->log Message left by the creator of this revision, explaining the changes.
$node->revision_timestamp Unix timestamp showing when current revision was created.
$node->format which filter applies to this content.
$node->name Username of node creator.
$node->picture User avatar of the node creator.
$node->date Long date, including timezone data, of when the node was created.
$node->revision TRUE/FALSE this is a new revision (if TRUE, will be saved as a separate entry in the database).
$node->menu Array containing the menu item assigned to the node.

5.x - $node - Node object

$node->nid Node ID.
$node->type Type of node (e.g. book, page, forum).
$node->language The default language for this node.
$node->uid User ID of node creator.
$node->status unpublished/published (0|1).
$node->created UNIX timestamp of node creation date.
$node->changed UNIX timestamp of last time node was changed.
$node->comment whether comments can be added, read, or accessed, for this node.
$node->promote Promoted to front page (0|1).
$node->moderate Moderation enabled (0|1).
$node->sticky Sticky (0|1).
$node->tnid The node ID of the translation source (or parent, if node is a translation).
$node->translate Is a translation (0|1).
$node->vid The revision ID of the current version of this node.
$node->revision_uid The user ID of the user who created the current revision.
$node->title Page (or, more accurately, node) title.
$node->body Body content of node.
$node->teaser Teaser (the initial part of the body).
$node->log Message left by the creator of this revision, explaining the changes.
$node->revision_timestamp Unix timestamp showing when current revision was created.
$node->format which filter applies to this content.
$node->name Username of node creator.
$node->picture User avatar of the node creator.
$node->date Long date, including timezone data, of when the node was created.
$node->revision TRUE/FALSE this is a new revision (if TRUE, will be saved as a separate entry in the database).
$node->menu Array containing the menu item assigned to the node.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

Edit: thought getting this info would be simple, but as PHP is very dynamic with objects.. well anyways.
$file objects generated by file_scan_directory() look like this:

$file->filename
full path from drupal root
$file->basename
filename
$file->name
filename excluding extension

file_check_upload() also creates these fields:

$file->filepath
full path from drupal root?
$file->filemime
mimetype
$file->source
where did the file come from

do does even reach anywhere outside the function? Is there a better way to dump this information?

See API book

$node->taxonomy is an array of taxonomy objects, as returned by taxonomy_get_term. Here's an example term:

<?php
// Taxonomy term ID is the same number as the key in the $node->taxonomy array
$node->taxonomy[1234]->tid = 1234;
// Vocabulary ID
$node->taxonomy[1234]->vid = 7;
// Readable label for the term
$node->taxonomy[1234]->name = "term label";
// Longer description for the term
$node->taxonomy[1234]->description = "longer description";
// Weighting of the term, if they've been re-ordered from alphabetical
$node->taxonomy[1234]->weight = 0;
// More terms
$node->taxonomy[5678]->tid = 5678;
// ...
?>

Each CCK field you add in the admin interface is represented on a node by a new attribute, invariably beginning "field_" e.g. $node->field_venue or $node->field_subtitle. These are numbered arrays, even if the field is single valued (it's a single-value array). Each CCK field array element is itself an array, with field names which typically match the columns in the database where the CCK data is stored.

<?php
// Text CCK field
$node->field_subtitle = array(
 
0 => array(
   
// Textual content stored in e.g. a field_subtitle_value column,
    // so this ends up in the array key "value"
   
"value" => "This is the subtitle",
  ),
);
// Long-text CCK field includes a "format" term for HTML filtering
$node->field_summary = array(
 
0 => array(
   
"value" => "Some text with <strong>markup</strong> in it",
   
// Format e.g. Full HTML or Filtered HTML stored by numeric ID
   
"format" => 1
 
),
);
// Node reference CCK field
$node->field_venue = array(
 
0 => array(
   
// Node ID stored in e.g. a field_venue_nid column,
    // so this ends up in the array key "nid"
   
"nid" => 123,
  ),
);
// Multiple-value CCK field
// Node reference CCK field
$node->field_see_also = array(
 
0 => array(
   
"nid" => 123,
  ),
 
1 => array(
   
"nid" => 456,
  ),
 
2 => array(
   
"nid" => 789,
  ),
);
?>

--
J-P Stacey, freelance Drupal developer | www.jpstacey.info

For the node path, if you have the path and pathauto module installed, you get a $node->path var.

This is the alias-ed path for you to check!

Nothing unreal exists.

Is this still true for Drupal 7? I couldn't get this property in D7.

But this works:
drupal_lookup_path('alias',"node/".$node->nid);

And I can't imagine why that function would exist if you could just call it in the object.

Saw that this is how it's done now. Thank you for the reply.

Thank you for posting this. Most handy page ever.

I had a problem: How to show the count (total) of Nodes on Faceted Search Guided Search.

Solution: Computed CCK field.

Approach:
1 - Created my Computed field and passed the: $node->language;

<?php
$node_field
[0]['value'] = $node->language;
?>

I hope this help somebody with the same problem in the future =D
enjoy

Wils
Never is to late for refactoring =D

Could we have these objects documented in api.drupal.org?

For example I am looking for a user object documentation, but cannot find any.

There is another request for this at #681768: Documentation on $node object is missing

Scott Jackson
Wollongong NSW Australia

Yea this would be great

What about null objects?

great post,i got it working afer some hours now
munka állás