
NYT Cooking Scraper
2 hours trial then $20.00/month - No credit card required now

NYT Cooking Scraper
2 hours trial then $20.00/month - No credit card required now
Scrapes recipe data from a New York Times Cooking recipe page. It extracts key details such as the recipe name, ingredients, instructions, cooking time, servings, and nutrition facts.
Actor Metrics
1 monthly user
No reviews yet
No bookmarks yet
>99% runs succeeded
Created in Mar 2025
Modified 4 days ago
NYT Cooking Recipe Scraper
Overview
Scrapes recipe data from a New York Times Cooking recipe page. It extracts key details such as the recipe name, ingredients, instructions, cooking time, servings, and nutrition facts.
Features
- Extracts recipe title, author, and description
- Scrapes ingredient list and preparation steps
- Captures cooking time, servings, and difficulty level
- Retrieves nutrition facts if available
- Outputs structured JSON data
Usage
Input
The Actor accepts a JSON input with the following structure:
1{ 2 "url": "https://cooking.nytimes.com/recipes/1025701-crispy-gnocchi-with-spinach-and-feta" 3}
Output
The output is structured JSON data containing the scraped recipe details:
1"contentAttribution": { 2 "cardByline": "Hetty Lui McKinnon", 3 "topnoteSigner": "", 4 "primaryByline": { 5 "prefix": "By", 6 "authors": [ 7 { 8 "name": "Hetty Lui McKinnon", 9 "link": "/search?q=Hetty+Lui+McKinnon" 10 } 11 ] 12 }, 13 "secondaryByline": { 14 "prefix": "", 15 "authors": [] 16 } 17 }, 18 "id": 1025701, 19 "image": { 20 "caption": "", 21 "credit": "Julia Gartland for The New York Times. Food Stylist: Samantha Seneviratne.", 22 "src": { 23 "card": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-mediumThreeByTwo440.jpg", 24 "article": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-jumbo.jpg", 25 "seoImage": "" 26 }, 27 "crops": { 28 "collection": {}, 29 "recipe": { 30 "XS": { 31 "height": 241, 32 "name": "tmagSF", 33 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-tmagSF.jpg", 34 "width": 362 35 }, 36 "S": { 37 "height": 320, 38 "name": "blog480", 39 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-blog480.jpg", 40 "width": 480 41 }, 42 "M": { 43 "height": 512, 44 "name": "master768", 45 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-master768.jpg", 46 "width": 768 47 }, 48 "L": { 49 "height": 683, 50 "name": "jumbo", 51 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-jumbo.jpg", 52 "width": 1024 53 }, 54 "XL": { 55 "height": 1000, 56 "name": "threeByTwoMediumAt2X", 57 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-threeByTwoMediumAt2X.jpg", 58 "width": 1500 59 } 60 }, 61 "card": { 62 "XS": { 63 "height": 293, 64 "name": "mediumThreeByTwo440", 65 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-mediumThreeByTwo440.jpg", 66 "width": 440 67 } 68 }, 69 "rotd": { 70 "XS": { 71 "height": 293, 72 "name": "mediumThreeByTwo440", 73 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-mediumThreeByTwo440.jpg", 74 "width": 440 75 }, 76 "S": { 77 "height": 293, 78 "name": "mediumThreeByTwo440", 79 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-mediumThreeByTwo440.jpg", 80 "width": 440 81 }, 82 "M": { 83 "height": 293, 84 "name": "mediumThreeByTwo440", 85 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-mediumThreeByTwo440.jpg", 86 "width": 440 87 }, 88 "L": { 89 "height": 293, 90 "name": "mediumThreeByTwo440", 91 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-mediumThreeByTwo440.jpg", 92 "width": 440 93 }, 94 "XL": { 95 "height": 1000, 96 "name": "threeByTwoMediumAt2X", 97 "url": "https://static01.nyt.com/images/2024/08/20/multimedia/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp/hm-crispy-gnocchi-with-spinach-and-fetarex-wjzp-threeByTwoMediumAt2X.jpg", 98 "width": 1500 99 } 100 } 101 } 102 }, 103 "ingredients": [ 104 { 105 "name": "", 106 "ingredients": [ 107 { 108 "text": "ounces baby spinach", 109 "quantity": "5" 110 }, 111 { 112 "text": "ounces Greek feta, crumbled (about 1 cup)", 113 "quantity": "6" 114 }, 115 { 116 "text": "lemon, halved", 117 "quantity": "1" 118 }, 119 { 120 "text": "tablespoons extra-virgin olive oil", 121 "quantity": "5" 122 }, 123 { 124 "text": "Salt and pepper", 125 "quantity": "" 126 }, 127 { 128 "text": "(16- to 17-ounce) package potato gnocchi (shelf-stable, fresh or frozen)", 129 "quantity": "1" 130 }, 131 { 132 "text": "teaspoon crushed red pepper", 133 "quantity": "1/4 to 1/2" 134 }, 135 { 136 "text": "scallions, thinly sliced", 137 "quantity": "2" 138 }, 139 { 140 "text": "Big handful of chopped dill", 141 "quantity": "" 142 }, 143 { 144 "text": "Big handful of chopped mint", 145 "quantity": "" 146 } 147 ] 148 } 149 ], 150 "nutritionalInformation": [ 151 { 152 "header": "Nutritional analysis per serving (4 servings)", 153 "description": "442 calories; 26 grams fat; 8 grams saturated fat; 0 grams trans fat; 14 grams monounsaturated fat; 2 grams polyunsaturated fat; 42 grams carbohydrates; 5 grams dietary fiber; 2 grams sugars; 12 grams protein; 684 milligrams sodium", 154 "source": "edamam" 155 } 156 ], 157 "publishedAt": 1724112000, 158 "modifiedAt": 1724112000, 159 "ratings": { 160 "avgRating": 5, 161 "numRatings": 3130 162 }, 163 "recipeYield": "4 servings", 164 "steps": [ 165 { 166 "name": "", 167 "steps": [ 168 { 169 "number": 1, 170 "description": "Place the spinach into a large bowl. Add half of the feta, juice of 1/2 lemon, 1 tablespoon of olive oil and a big pinch of salt; rub the ingredients vigorously into the spinach to tenderize it. Leave to sit and soften further while you cook the gnocchi.", 171 "media": null 172 }, 173 { 174 "number": 2, 175 "description": "Heat a large (about 12-inch) cast-iron or nonstick skillet over medium-high; add 2 tablespoons of olive oil. Add the gnocchi to the pan, breaking up any that are stuck together. Cook for 8 to 10 minutes, tossing every 2 minutes, until golden and crispy all over. Allow to cool in the pan for 5 minutes; they will further crisp as they cool.", 176 "media": null 177 }, 178 { 179 "number": 3, 180 "description": "Add the gnocchi to the spinach, along with the red pepper, scallions, dill and mint. Drizzle with about 2 tablespoons of olive oil, add the remaining crumbled feta and toss to combine. Squeeze the remaining lemon juice over top and serve.", 181 "media": null 182 } 183 ] 184 } 185 ], 186 "tips": [], 187 "title": "Crispy Gnocchi With Spinach and Feta", 188 "topnote": "Inspired by the herbaceous and jaunty flavors of <a href=\"https://cooking.nytimes.com/recipes/1020101-spanakopita\">spanakopita</a>, the savory, ever popular Greek pie, spinach and feta headline this textural gnocchi salad. The spinach is not cooked, but is simply massaged, which softens it while ensuring it maintains its leafy structure. Incorporating some feta to the spinach massage is a functional move — the salt in the feta helps to tenderize the leaves — but it also adds a hint of quiet luxury to this dish, as the leaves become coated with the creamy, briny cheese. Be heavy-handed with your herbs and lemon, as these bring boldness and freshness that play off the saltiness of the feta. Everyday shelf-stable gnocchi from your local supermarket is perfect for crisping in the pan; if you choose to use frozen variety, no defrosting is required.", 189 "url": "/recipes/1025701-crispy-gnocchi-with-spinach-and-feta", 190 "fullUrl": "https://cooking.nytimes.com/recipes/1025701-crispy-gnocchi-with-spinach-and-feta", 191 "cookTime": "20 minutes", 192 "prepTime": "5 minutes", 193 "totalTime": "25 minutes"
How It Works
- The Actor receives a recipe URL as input.
- It loads the page and extracts the relevant details using Cheerio or Puppeteer.
- The extracted data is formatted into a structured JSON output.
- The JSON output is stored and can be accessed via the Apify dataset.
Setup
- Deploy the Actor on Apify
- Provide the necessary URL as input
- Run the Actor and retrieve the structured recipe data
Limitations
- Requires valid access to NYT Cooking (some recipes may be behind a paywall)
- May require adjustments if the NYT Cooking website structure changes
License
MIT License