Try this,
$cat = get_category_by_path('http://www.example.com/category/category-name/')
Reference http://codex.wordpress.org/Function_Reference/get_category_by_path
Try this,
$cat = get_category_by_path('http://www.example.com/category/category-name/')
Reference http://codex.wordpress.org/Function_Reference/get_category_by_path