I am trying to get all recently viewed product's id programmatically . I tried to check the reports/product_viewed and reports/product_abstract. But couldn't figure it out.
Try this code:
$collection = Mage::getSingleton('Mage_Reports_Block_Product_Viewed')->getItemsCollection();
If you like to get only the IDs and don't want extra logic from the block, you can try to use directly this:
$ids = Mage::getModel('reports/product_index_viewed')->getCollection()->getAllIds();